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?
> -----Original Message----- > From: Andy Eastham [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 01, 2003 12:29 PM > To: [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 > HAVING count(p1.email) > 1 > > Andy > > > -----Original Message----- > > From: Bob Sawyer [mailto:[EMAIL PROTECTED] > > Sent: 01 April 2003 21:04 > > To: MySQL List > > Subject: Opposite of DISTINCT() > > > > > > I know that using SELECT DISTINCT(colname) will result in > output that does > > not contain any duplicates from that column. But how would I > > output JUST the > > duplicates? If I have as part of a table a column containing email > > addresses, and I want to list just the duplicate addresses > rather than the > > distinct addresses, what's the syntax there? > > > > Thanks, > > Bob > > > > > > > > -- > > MySQL General Mailing List > > For list archives: http://lists.mysql.com/mysql > > To unsubscribe: > > http://lists.mysql.com/[EMAIL PROTECTED] > > > > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]