Link to home
Start Free TrialLog in
Avatar of Steynsk
SteynskFlag for Netherlands

asked on

Select only values that do not start with a uppercase character

Hi Expert,

I'd like to extract all values from a field that do not start with a uppercase character.

But extracting all values without uppercase characters would work as well.

Kind regards,
Avatar of Swapnil Nirmal
Swapnil Nirmal
Flag of India image

Use Binary:

SELECT *
FROM Table1
WHERE BINARY UPPER(Left('Field1',1) = Left('Field1',1)


Just for reference:
http://dev.mysql.com/doc/refman/5.0/en/charset-binary-op.html
Avatar of Steynsk

ASKER

Hi n_swapnil,

Thanks for the quick responce. but the statement selects all records:

SELECT * FROM people WHERE BINARY UPPER(Left('givenname',1) = Left('givenname',1))

And instead of that it should only show the people with a givenname without uppercase characters.

thanks
Try this:

SELECT * FROM people WHERE BINARY LOWER(Left('givenname',1) = Left('givenname',1))
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steynsk

ASKER

SELECT * FROM people where ((BINARY `givenname`) REGEXP '^[a-z]')

did the job.

Thanks