[SOLVED] PostgreSQL: get all rows that contain an uppercase letter

Issue

How can I do the following stmt:

select * from table
where column has any uppercase letters; <-- how to write this

Solution

You can filter with a regex:

select * 
from mytable
where mycolumn ~ '[A-Z]'

Another approach is string comparison:

select * 
from mytable
where lower(mycolumn) <> mycolumn

Answered By – GMB

Answer Checked By – Robin (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *