Copy link to clipboard
Copied
Hi,
I've a question regarding this issue. I am pulling data from an xml file and dump that data into query of queries then output them. The problem is when I try to order the query ASC, the upper will be top and the lower will be on the bottom. Is there a way to sort them before dump data into query? Or any ways of getting around this?
Thanks.
sql upper() and lower() functions work in Q of Q.
Copy link to clipboard
Copied
sql upper() and lower() functions work in Q of Q.
Copy link to clipboard
Copied
Thank you.
Edit. Fixed. Have to put upper() and lower() on the select column and order by.
Copy link to clipboard
Copied
Depending on your requirements, you might want to add a new column to the query, rather than calling upper() on your actual data column... it depends on whether you want your data column to be all upper case (like if you are displaying it).
So instead of this:
SELECT col1, upper(col2)
FROM q
ORDER BY col2
Have this:
SELECT col1, col2, upper(col2) AS col2Sort
FROM q
ORDER BY col2Sort
It doesn't always matter, obviously, but it's handy to keep it in mind.
--
Adam