hi all Database Masters

Here i have suffer one critical issue,i have two column a and b,


Table name : Student
"A" "B"
"1" "SAntOsh"
"2" "SAuraV"
"3" "SAriya"
"4" "SAnju"
"5" "SAthiYa"


These are the sample records from my Table field. The "B" column always start with 'SA', the problem now in column B that has capital letter and I need to sort out all B that only has CAPITAL letter inside the letter and the out put will be displayed like this

A B
"1" "SAntOsh"
"2" "SAuraV"
"5" "SAthiYa"

Please help me out for this question :icon_cry:

Thanks in Advance

Recommended Answers

All 3 Replies

... I need to sort out all B that only has CAPITAL letter inside the letter and the out put will be displayed like this

A B
"1" "SAntOsh"
"2" "SAuraV"
"5" "SAthiYa"

Please help me out for this question :icon_cry:

Thanks in Advance

You need a regular expression. Something like this will match rows that contain at least one capital letter in the remainder of the field:

select * from myTable where myField regexp 'CAPS.*[A-z]';

You need a regular expression. Something like this will match rows that contain at least one capital letter in the remainder of the field:

select * from myTable where myField regexp 'CAPS.*[A-z]';

hi Fest3er

Thanks for giving the reply

but when I try which querry you send me but it doesn't give the out put

select * from student where b regexp 'CAPS.*[A-z]';

Please help me out.

thanks

hi Fest3er

Thanks for giving the reply

but when I try which querry you send me but it doesn't give the out put

select * from student where b regexp 'CAPS.*[A-z]';

Please help me out.

thanks

You're quite right; it doesn't work, and wasn't supposed to work verbatim. :)

The regular expression needs to be a pattern that matches your data, not the fictitious data in my fictitious table. That bit of learning is left as an exercise for the student (you). :) :)

commented: Excellent response +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.