2 ms·
“First” doesn’t make sense without an order
by fiddlerwoaroof 4y ago
“First” doesn’t make sense without an order
- snidane 4y agoIt does make sense for semi-joins. I care about the key, not the value. Random order is also a valid order.
- deleted 4y ago[deleted]
- jodrellblank 4y agoIt even has its own tag on StackOverflow: https://stackoverflow.com/questions/tagged/greatest-n-per-group https://stackoverflow.com/questions/tagged/greatest-n-per-gr... People who want it, want it with an order. Look at https://stackoverflow.com/questions/121387/fetch-the-row-which-has-the-max-value-for-a-column/123481 https://stackoverflow.com/questions/121387/fetch-the-row-whi... and https://stackoverflow.com/questions/3800551/select-first-row-in-each-group-by-group https://stackoverflow.com/questions/3800551/select-first-row... and https://stackoverflow.com/questions/8748986/get-records-with-highest-smallest-whatever-per-group/8749095 https://stackoverflow.com/questions/8748986/get-records-with... and their combined thousands of votes and dozens of answers, all full of awkward workaround or ill-performing or specialised-for-one-database-engine code for this common and desirable thing which would be trivial with a couple of boring loops in Python.