Skip to content

Instantly share code, notes, and snippets.

@somoza
Created May 16, 2022 14:43
Show Gist options
  • Save somoza/eced65d8a136e87a8bc7e6e4484177a5 to your computer and use it in GitHub Desktop.
Save somoza/eced65d8a136e87a8bc7e6e4484177a5 to your computer and use it in GitHub Desktop.
Query to show detailed list of repeated combinations, without using group by
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