SELECT DISTINCT and WHERE ... or something else?

    Date: 03/21/06 (MySQL Communtiy)    Keywords: sql

    I have a query which selects a columns from a table however, there are repeats. I understand to get just one request of the value I'd use SELECT distinct.

    However the SELECT statement also displays information from a second column and I want only the highest value.

    What I want effectively is SELECT DISTINCT columnA and columnB WHERE column B is the highest value in the record for colum A.

    Thanks in advance. It's been a while since I've done these regularly and my brain has turned to SQL-mush. It'll come back tho', I promise.

    Source: http://community.livejournal.com/mysql/90364.html

« Query two lookup tables || Ordering by numbers(?) »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home