Friday, 19 July 2019

MySQL: how to get records with count > 1?

SELECT *, count(*) as cc 
FROM manytomany 
GROUP BY aid, bid
HAVING 1 < count(*)
ORDER BY cc DESC

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Blog Archive