Jennifer Goodie wrote:
Why the join? Why not just "select p1.email, count(*) as occurances from
table p1 group by p1.email having occurances > 1"? Am I missing something?
Possibly. It depends on whether the OP wanted to see which rows had
duplicates, or to actually *see* the duplicates, in whi
Question answered.
Thanks to all who responded.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
: [EMAIL PROTECTED] Mysql. Com
> Subject: RE: Opposite of DISTINCT()
>
>
> Bob,
>
> You have to do a self join - try this off the top of my head... -
>
> Select p1.email
> FROM tblperson p1, tblperson p2
> WHERE p1.email = p2.email
> GROUP BY p1.email
> HA
To find duplicates, use something like:
SELECT address, count(*)
>From Customer
GROUP BY address
HAVING count(*) > 1;
-Original Message-
From: Bob Sawyer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 12:04 PM
To: MySQL List
Subject: Opposite of DISTINCT()
I know that using SE
Bob,
You have to do a self join - try this off the top of my head... -
Select p1.email
FROM tblperson p1, tblperson p2
WHERE p1.email = p2.email
GROUP BY p1.email
HAVING count(p1.email) > 1
Andy
> -Original Message-
> From: Bob Sawyer [mailto:[EMAIL PROTECTED]
> Sent: 01 April 2003 21:0
SELECT col1
FROM table1
GROUP by col1
HAVING count(col1) > 1
-ms
-Original Message-
From: Bob Sawyer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 12:04 PM
To: MySQL List
Subject: Opposite of DISTINCT()
I know that using SELECT DISTINCT(colname) will result in output that do