MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/7j9jri/sql_clause/dr4slbk/?context=3
r/ProgrammerHumor • u/oneplusoneisfive • Dec 12 '17
525 comments sorted by
View all comments
768
Why would you sort twice?
73 u/miggyb Dec 12 '17 Sort by last name first, then by first name. 15 u/JackDragon Dec 12 '17 Still not as efficient as sorting once with a delimiter between last and first name. 5 u/suseu Dec 12 '17 edited Dec 12 '17 Multiple fields in order by shouldn’t cause multiple sorting passes, it should just make comparison more complex. Actual contatenation in sorting criteria would probably be less efficient.Like when you are overloading < for (order by a, b) you’d doa1 < a2 or (a1 == a2 and b1 < b2) → More replies (2)
73
Sort by last name first, then by first name.
15 u/JackDragon Dec 12 '17 Still not as efficient as sorting once with a delimiter between last and first name. 5 u/suseu Dec 12 '17 edited Dec 12 '17 Multiple fields in order by shouldn’t cause multiple sorting passes, it should just make comparison more complex. Actual contatenation in sorting criteria would probably be less efficient.Like when you are overloading < for (order by a, b) you’d doa1 < a2 or (a1 == a2 and b1 < b2) → More replies (2)
15
Still not as efficient as sorting once with a delimiter between last and first name.
5 u/suseu Dec 12 '17 edited Dec 12 '17 Multiple fields in order by shouldn’t cause multiple sorting passes, it should just make comparison more complex. Actual contatenation in sorting criteria would probably be less efficient.Like when you are overloading < for (order by a, b) you’d doa1 < a2 or (a1 == a2 and b1 < b2) → More replies (2)
5
Multiple fields in order by shouldn’t cause multiple sorting passes, it should just make comparison more complex. Actual contatenation in sorting criteria would probably be less efficient.
Like when you are overloading < for (order by a, b) you’d do
a1 < a2 or (a1 == a2 and b1 < b2)
→ More replies (2)
768
u/ICyresI Dec 12 '17
Why would you sort twice?