[nycphp-talk] Ignoring records with duplicate keys
Christopher Hendry
chendry at nyc.rr.com
Wed May 26 22:18:48 EDT 2004
Is this a question?
SELECT DISTINCT title, id, name from table GROUP BY title;
Might actually need the GROUP BY on all (ie, GROUP BY title, id, name), or
some functions, I just did this, if it helps:
Select DISTINT carriers, MIN(price) as price, maxStops from paxflights where
paxiticket = 'abcde12345' GROUP BY carrier, maxStops;
C
-> -----Original Message-----
-> From: talk-bounces at lists.nyphp.org
-> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Chris Snyder
-> Sent: Wednesday, May 26, 2004 10:01 PM
-> To: NYPHP Talk
-> Subject: [nycphp-talk] Ignoring records with duplicate keys
->
-> You have a table with id, name, and title fields.
->
-> You want to create a query that selects * where title is
-> distinct -- that is, if two or more records have the same
-> title, only the fields from the first are be returned.
->
-> Should be easy, right?
-> _______________________________________________
-> talk mailing list
-> talk at lists.nyphp.org
-> http://lists.nyphp.org/mailman/listinfo/talk
->
More information about the talk
mailing list