MySQL Forums
Forum List  »  Newbie

Re: Getting the result
Posted by: Gaby Lopez
Date: May 27, 2015 01:38PM

I'm closer:

SELECT comm_name, COUNT(id_user) AS idu FROM (commerces_users
INNER JOIN commerces
ON id_comm = comm_id)
GROUP BY id_comm
HAVING COUNT(idu) = 1;

Now, I can get the commerces which have just one owner. Now, next step would be delete those commerces.... Could I add DELETE before SELECT? What do you think?

Options: ReplyQuote


Subject
Written By
Posted
May 27, 2015 05:10AM
Re: Getting the result
May 27, 2015 01:38PM
June 01, 2015 01:04PM


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.