0

How can I sort by column name that is reserved word? For example:

select * from some_table t1 order by t1.mode;

mode is our reserved word. It cannot be changed, moreover I need select to be used with identifier t1. So far I've tried:

order by t1."mode", "t1.mode", t1.'mode', 't1.mode'

Without any luck

3
  • You pasted 10g reserved word list, I'm working with 11g :) docs.oracle.com/cd/E14072_01/server.112/e10592/ap_keywd.htm Commented Dec 13, 2012 at 15:05
  • the word is mode, not more Commented Dec 13, 2012 at 15:07
  • never mind, I misread you, sorry ;) Commented Dec 13, 2012 at 15:07

1 Answer 1

3

The correct way is to use double quotes. But if you use double quotes, column names become case-sensitive. So it's probably

ORDER BY t1."MODE"
Sign up to request clarification or add additional context in comments.

1 Comment

Funny thing is that I didnt even think about it :) Thank you so much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.