PDA

View Full Version : Need help with a query


Sebbe
02-17-2006, 02:13 PM
Hi, could anybody help me to formulate a SQL query which retrives all posts where there's doublets of a specified field. Like if there's 2 posts which has the number 200 as ID for example, they would qualify, but if the id is unique it shouldn't qualify for the query.

Any help appriciated.

Kid Charming
02-17-2006, 06:16 PM
SELECT
foo
,bar
,columnwithdups
FROM
table
GROUP BY
columnwithdups
HAVING
COUNT(columnwithdups) > 1