Here's something I can't quite wrap my head around. I'm using MySQL 4.0.5.
Suppose I have a table like this...
company | product | price | comment
-----------------------------------
a | apple | 6 | nonsense
a | orange | 5 | foo
b | apple | 3 | bar
b | orange | 5 | blah
I want to select the one row per company that has the lowest price, regardless of anything else. Ie. the two rows in the middle are the ones I'm after.
Yes, I do indeed want to compare apples to oranges. 🙂