Order by is allowed only on the outermost select in ANSI. It is meant to define 
the order of the final results of the query returned to the user. It is not 
allowed in sub queries.
Rohit

-------- Original message --------
From: "Liu, Ming (Ming)" <[email protected]> 
Date: 03/24/2016  2:15 AM  (GMT-06:00) 
To: [email protected] 
Subject: Does Trafodion support to use 'order by' in a subquery 



Hi, all,
 
I don’t know if this is same in other database, but in Trafodion, if I want to 
have a subquery which have a ‘order by’, it seems not allowed. Is this normal 
or a limitation in Trafodion?
For example:
 
create table t1 ( c1 int, c2 int);
 
select * from (
   Select * from t1 order by c1);
*** ERROR[15001] A syntax error occurred at or before:
select * from (select * from t1 order by c1);
                                           ^ (44 characters from start of SQL 
statement)
 
Thanks in advance,
Ming
 

Reply via email to