SQL Fun

Posted on 2006-02-10 in misc

Had a bit of fun today, trying to pick out only singleton entries from a database table, finding the lowest unique bid for the reverse auction app i'm doing at work. this is what i came up with:

1
2
3
4
5
6
7
SELECT *
FROM bids
WHERE auction_id = 1
GROUP BY value
HAVING ( COUNT( value ) =1 )
ORDER BY value ASC
LIMIT 1;