The below query is giving error:
SELECT DISTINCT dealer_state
FROM A
WHERE country='SS'
UNION
SELECT DISTINCT dealer_state
FROM B
WHERE country='SS'
ORDER BY upper(dealer_state)
How to sort using upper(column) in order by clause?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming that the “error” your query is giving is that it’s not ordering records from
Bamongst records fromAas you had expected, you need to make yourUNIONquery a subquery to one that performs the ordering: