Bingo ! works fine
many thx
regadrs
Gerhard
-----Ursprüngliche Nachricht-----
Von: Ian Gibbons [mailto:mysql1@stripped]
Gesendet: Donnerstag, 5. August 2004 11:17
An: Gerhard Brauckmann; win32@stripped
Betreff: Re: how to find duplicated entries within a table?
On 5 Aug 2004 at 10:50, Gerhard Brauckmann wrote:
> Hello all,
>
> I m trying to find duplicate entries in a specific table colum.
> Does anyone of you have an idea how to do this by query?
>
> example, my data: "John", "Willi", "Martha", "John", "Mike", "Sammy",
"Mike"
>
> Now i would select ONLY the double entries in this data-table.
> The result should look like this:
>
> John,John, Mike, Mike
Hi,
We could do with a bit more information about your table structure to get
this right.
But here's a guess anyway...
If the the column which you are checking is called *FirstName* then the
query would be:
SELECT FirstName, Count(FirstName) as
DuplicateCount
FROM tablename
GROUP BY FirstName
HAVING DuplicateCount>1;
This would give you a list if all the FirstName's that appear more than
once.
For more information on the GROUP BY syntax see the manual at:
<http://dev.mysql.com/doc/mysql/en/GROUP-
BY-Functions.html>
Regards
Ian
--