MySQL Forums
Forum List  »  Newbie

Re: Listing Duplicate Rows
Posted by: Ray Rose
Date: March 24, 2005 04:23PM

David Fells wrote:
> SELECT field, COUNT(*) AS occurs FROM table GROUP
> BY field HAVING occurs > 2

Thanks David for the example.

This is about as far as I have ever gotten trying it myself. The issue here is that when I use COUNT() I believe I am required to use GROUP BY also cause otherwise I get an error removing it. GROUP BY is the annoyance here because I do not want to return duplicates in singles listing. I want to return ALL duplicates like I had shown in my example. I can think of ways to do this in MySQL 4.1 but I have NOT found anything successfull for MySQL 4.0 version. I tried ways of "sub-selecting" but had no luck what so ever.

Any ideas?

Options: ReplyQuote


Subject
Written By
Posted
March 24, 2005 03:42PM
March 24, 2005 04:14PM
Re: Listing Duplicate Rows
March 24, 2005 04:23PM
March 24, 2005 04:25PM
March 24, 2005 04:32PM
March 24, 2005 04:36PM
March 24, 2005 07:02PM
March 24, 2005 07:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.