Yang Yang created TRAFODION-2066:
------------------------------------

             Summary: Not allowing Order By the aggregation, except when named
                 Key: TRAFODION-2066
                 URL: https://issues.apache.org/jira/browse/TRAFODION-2066
             Project: Apache Trafodion
          Issue Type: Bug
    Affects Versions: 2.1-incubating
         Environment: EsgynDB Advanced Release 2.1.0
JDBC Type 4, 
            Reporter: Yang Yang
            Priority: Minor


It's not allowed to Order By aggregates, unless a name is given to the 
aggregate. For example, 
Illegal to do "select id, groupid, sum(score)  from t group by id, groupid  
order by sum(score)".   but it's legal to do "select id, groupid, sum(score) as 
ttlscore from t group by id, groupid, order by ttlscore". 

This may not be a problem with window functions. I've seen an example Trafodion 
query:
"select  username as userid,groupid,sum(allowed_size) as bandwidth, 
row_number()  over (partition by groupid order by SUM(allowed_size) desc) as 
row_number  from u_f-mv" . 

This is not a blocking bug, but for those who'd like to test drive Trafodion, 
the alternative of naming the aggregate may be put into SQL manual for now, 
before the bug is fixed. 






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to