select v1.* from dim_y v1
join (
select nk_record_id, count(*) from dim_y
group by nk_record_id
having count(*) > 1
) v2
on v1.nk_record_id = v2.nk_record_id
Corrected version:
select v1.* from dim_y v1
join (
select nk_record_id, count(*) cnt from dim_y
group by nk_record_id
having count(*) > 1
) v2
on v1.nk_record_id = v2.nk_record_id
No comments:
Post a Comment