Skip to content

Instantly share code, notes, and snippets.

@dclarke-modus
Created December 12, 2017 11:39
Show Gist options
  • Save dclarke-modus/45adfea41b0354f470d5ddd956a5a5f9 to your computer and use it in GitHub Desktop.
Save dclarke-modus/45adfea41b0354f470d5ddd956a5a5f9 to your computer and use it in GitHub Desktop.
Table Students
id, name
1, Dean
2, Dean
3, Shahib
@dclarke-modus
Copy link
Author

Write a query that only display the duplicate row and how many times it's duplicated. Example:

name, count
Dean, 2

@shahidkarimi
Copy link

select name, count(name) as count
group by name
having count > 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment