chr
chr

Reputation: 11

SQL2: Case insensitive sort

Is it possible to do a case insensitive sort in SQL2? The following statement sorts the results like [c, b, a, C, B, A] and we desire [c, C, b, B, a, A].

SELECT * FROM [nt:unstructured] WHERE [sling:resourceType] = 'photo' ORDER BY [photoTitle] desc

Thanks in advance for your help!

Upvotes: 0

Views: 503

Answers (1)

chr
chr

Reputation: 11

Ok, I found a solution that works for me. Just add the lower function to the column name like this:

SELECT * FROM [nt:unstructured] WHERE [sling:resourceType] = 'photo' ORDER BY LOWER([photoTitle]) desc

Better solutions are welcome!

Upvotes: 1

Related Questions