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

It's actually super useful if you've got a table with two columns like "sku" and "product_name", where the value in both columns has one unique value from the other column paired with it. You can group by sku, and then grab any value for product_name, since they're all the same. Using min/max/etc involves extra computations that you don't need to do.

You could group by the combination of sku+product_name, but it's kind of unwieldy. You could also normalize it to not have this issue, but when you're getting this data from someone else, there's not much you can do.



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

Search: