adobeaemcase-insensitivejcrjcr-sql2

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!


Solution

  • 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!