Created
May 16, 2022 14:43
-
-
Save somoza/eced65d8a136e87a8bc7e6e4484177a5 to your computer and use it in GitHub Desktop.
Query to show detailed list of repeated combinations, without using group by
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t1.id, t1.username, t1.client_id | |
FROM customers AS t1 | |
INNER JOIN( | |
SELECT username, client_id | |
FROM customers | |
GROUP BY username, client_id | |
HAVING COUNT(username) > 1 | |
)temp ON t1.username = temp.username | |
order by username, client_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment