DaveBirdsall opened a new pull request #1828: [TRAFODION-3296] Fix handling of 
[first n] + ORDER BY subqueries
URL: https://github.com/apache/trafodion/pull/1828
 
 
   Queries containing IN-subqueries involving both [first n] and ORDER BY were 
giving wrong results. The ORDER BY essentially was being ignored. This has now 
been fixed. The [first n] is now evaluated with respect to the ORDER BY clause.
   
   For [any n] + ORDER BY (or equivalently, LIMIT n + ORDER BY), the ORDER BY 
continues to be ignored, since [any n] does not specify which rows should be 
returned and therefore ordering has no importance.
   
   The combination [last n] + ORDER BY in an IN-subquery is now forbidden, and 
results in a 4484 error. The reason is that [last n] is typically used as a 
performance tool when used at the top level of a query, but that purpose makes 
no sense in the context of a subquery.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to