>How can I write a SQL statement that only retrns records where there are duplicate records in a given field. For example: Return all of the user records in states where there are more than one users.
>
>Scott Schuman
>Innovative Resource Group, Inc.
-----------------------------------------------------------------
If I undestand correctly, you wish to return records that match some criteria that return more than one record. This will return all users who live in states that have more than one user.
SELECT UserName, UserAddress, ...
FROM mytable
WHERE State IN (SELECT State, COUNT(UserID)
FROM mytable
GROUP BY State
HAVING COUNT(UserID) > 1)
Please let me know, if I missed the point completetly.
Aristotle