Returning non-unique rows without group by in SQL Server -
i have dig though data in few columns tables find non-distinct rows based off name
column , because each table has lots of columns (all on 50)
i don't want use group because of requirement explicitly declare every single column.
is there way of finding non-distinct rows allow using select *
?
if single table fin typing out column names right have 4 different tables go through , see me having go though many more run same process.
use window functions, in case, count(*)
:
select t.* (select t.*, count(*) on (partition name) namecnt table t ) t namecnt > 1;
Comments
Post a Comment