Skip to content

Instantly share code, notes, and snippets.

@haythamdouaihy
Created May 12, 2015 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haythamdouaihy/682d7c808933bc7704d0 to your computer and use it in GitHub Desktop.
Save haythamdouaihy/682d7c808933bc7704d0 to your computer and use it in GitHub Desktop.
SQL- rows having duplicate column value
-- query that returns duplicate colum value
select
count(<duplicated_column_name>),
<duplicated_column_name>,
<other>
from
<table_name>
group by
<duplicated_column_name>
HAVING
count(<duplicated_column_name>)>1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment