View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 07:43 PM
David Portas
 
Posts: n/a
Default Re: how to retrieve only the duplicates in a table

SELECT col1, col2, col3, ....
FROM Sometable
GROUP BY col1, col2, col3, ....
HAVING COUNT(*)>1

--
David Portas
------------
Please reply only to the newsgroup
--

"TimG" <timgru@hotmail.com> wrote in message
news:744d8a29.0311072031.75846c64@posting.google.c om...
> There is a table with a single column with 75 rows - 50 unique / 25
> duplicates. How would pull back a list of the rows that have/are
> duplicates?
>
> This is a question that I got in an interview. I didn't get it,
> obviously....
>
> Thanks,
>
> Tim



Reply With Quote