MySQL Forums
Forum List  »  New in 4.1: Subqueries

Re: Problem with "Find Duplicates" using subquery
Posted by: Michael Berkowitz
Date: March 16, 2005 11:47PM

Well,

I found that I could get the results I want by using the following query:

SELECT Donations.* FROM Donations inner join
(select * from Donations group by date,amt,donor having count(*)>1) as temp
on Donations.date = temp.date and Donations.amt = temp.amt and Donations.donor = temp.donor

I'm guessing the key is to give the table generated by the subquery a name, since the engine probably doesn't like using the same table name in both the inner and outer queries.

Still, one would think that it would either reject the query with a syntax error or process it correctly.

Michael

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Problem with "Find Duplicates" using subquery
4435
March 16, 2005 11:47PM


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.