I initially thought this is trivial. Then thought 'binary' might do it. I am unsure at this point.
Name
----
John
MARY
Kin
TED
I would like to query just MARY and TED which are in all upper case. How would I query this?
You just use the UPPER() function on the Name field and compare the results with the original value of Name:
select Name from Table where Name = UPPER(Name)
This way
UPPER(Name) || Name
---------------------------------------
JOHN != John
MARY == MARY
KIN != Kin
TED == TED
only the rows you need will be returned.
As @mdoyle commented here, you should define the column with the right collation (case sensitive), otherwise as others did answer you need the BINARY operator to compare case insensitive columns.
Try this:
select name from table where name=upper(name);
This will also return numeric values, but that doesnt look to be an issue for your column name.
SELECT * FROM names WHERE
ASCII(name) = ASCII(Upper(name))