[gameprogrammer] Re: SQL Question
- From: "Alan Wolfe" <alan.wolfe@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Fri, 11 Jan 2008 15:58:53 -0800
I'm not sure what database you're using, they each have their own
quirks about syntax and abilities but it should be something like
this...
select column1, column2, max(column3) from mytable group by column1,column2
On 1/11/08, Kevin Jenkins <gameprogrammer@xxxxxxxxxx> wrote:
> I want to order a table by a column, and return the first row that has
> a unique value for a different pair of columns.
>
> For example:
>
> Column_1, Column_2, Column_3
> John, Doe, $85
> John, Archer, $90
> Bob, Barker, $70
> John, Doe, $60
>
> It should return
> John, Doe, $85
> John, Archer, $90
> Bob, Barker, $70
>
> Because John, Doe appears twice, it only returns the row with the
> higher value for Column 3
>
> How would I do this?
>
> Thanks!
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
>
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- References:
- [gameprogrammer] SQL Question
- From: Kevin Jenkins
Other related posts:
- » [gameprogrammer] SQL Question
- » [gameprogrammer] Re: SQL Question
- [gameprogrammer] SQL Question
- From: Kevin Jenkins