A co powiesz na to: select id, first, last from mytable where first != upper(first) or last != upper(last);