×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: SQL
Posted by: Jon Nickerson
Added: Sep 19, 2017 8:28 PM
Views: 0
Tags: no tags
  1. WITH dup_recs AS (
  2.     SELECT *
  3.     FROM
  4.       (
  5.         SELECT
  6.           COUNT(*)
  7.           OVER (
  8.             PARTITION BY C.ALTID ) dups,
  9.           C.ALTID
  10.         FROM cfaw_stu C
  11.       )
  12.     WHERE dups > 1
  13. )
  14. SELECT * FROM cfaw_stu WHERE altid IN (SELECT altid FROM dup_recs);