SELECT fields
FROM table AS t1
WHERE EXISTS (SELECT 1
FROM table AS t2
WHERE t1.id = t2.id
HAVING count(*) = 1)
and/or
SELECT t1.id, t1.whatever1, t1.whatever2
FROM table AS t1 INNER JOIN table AS t2
ON t1.id = t2.id HAVING COUNT(*) = 1
GROUP BY t1.id, t1.whatever1, t1.whatever2
The first one doesn't work because my version of MySQL doesn't support
sub-queries. I'm getting ready to try the second.
----- Original Message -----
From: "Burns, John D" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, June 15, 2004 4:16 PM
Subject: RE: Select IDs that only have 1 entry
> I have thought about the same thing. I've also wondered about a "NOT
> DISTINCT" command to find records that do have duplicates. Anyone with
> any bright ideas?
>
> John
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

