0

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

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by Fest3er
0

... 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]';
0

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

1

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). :) :)

Votes + Comments
Excellent response
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.