For a while I thought, in order for the WHERE
criteria to be evaluated correctly, I need to account for case sensitivity. I would use UPPER()
and LOWER()
when case didn't matter. However, I am finding the below queries produce the same result.
SELECT * FROM ATable WHERE UPPER(part) = 'SOMEPARTNAME'
SELECT * FROM ATable WHERE part = 'SOMEPARTNAME'
SELECT * FROM ATable WHERE part = 'somepartname'
SQL Case Sensitive String Compare explains to use case-sensitive collations. Is this the only way to force case sensitivity? Also, if you had a case-insensitive collation when would UPPER()
and LOWER()
be necessary?
Thanks for help.