Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

“First” doesn’t make sense without an order


It even has its own tag on StackOverflow: 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-whi...

and

https://stackoverflow.com/questions/3800551/select-first-row...

and

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.


It does make sense for semi-joins. I care about the key, not the value.

Random order is also a valid order.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: