Last active
August 29, 2015 14:23
-
-
Save clintmjohnson/cfbe89181ea518166fe0 to your computer and use it in GitHub Desktop.
This Query Filters a SQL Server Table to only Dupicate Values
This file contains hidden or 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 o.model_number, oc.model_number | |
| from Product_Staging_Table o | |
| inner join ( | |
| SELECT model_number, COUNT(*) AS dupeCount | |
| FROM Product_Staging_Table | |
| GROUP BY model_number | |
| HAVING COUNT(*) > 1 | |
| ) oc on o.model_number = oc.model_number | |
| WHERE o.model_number <> '' AND o.model_number IS NOT NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment