Comentarios (4)

1 AndrejFurlanič ha hecho un comentario el Enlace permanente

Recently i upgraded a database from 9.5 to 9.7 and certain queryies involving distinct and order by started to fail with sql0214 rc2.

 
I found this APAR open for 9.7: APAR IC75127 . Thanks to your blog, we found that "truth lies somewhere between", and corrected our queries.
 

2 SergeRielau ha hecho un comentario el Enlace permanente

Andrej,

 
Always good to hear the blog helps someone :-)
 
Cheers
Serge

3 Tonkuma ha hecho un comentario el Enlace permanente

GROUP BY and ORDER BY MAX(visit) will work, too.

 
------------------------------ Commands Entered ------------------------------
SELECT name , firstname
FROM guests
GROUP BY
name , firstname
ORDER BY
MAX(visit) ASC
;
------------------------------------------------------------------------------
 
NAME FIRSTNAME
-------------------- --------------------
Gervais Gerald
Dreyfus Don
Eakes Edwin
Fox Frauke
Beaver Boris
Chambers Charlene
Jones Jeremy
 
7 record(s) selected.

4 SergeRielau ha hecho un comentario el Enlace permanente

Tonkuma,

 
SMART!
 
I never thought of adding an aggregate function to ORDER BY..
 
Cheers
Serge