sql - How to write the query that returns records where some column value appears more than once? -
sql - How to write the query that returns records where some column value appears more than once? -
i have table has column statuses. need write query returns records column value appears more once?
something this:
select * table1 count(statusid = 6) > 1
you can write query following:
select * table1 statusid in ( select statusid (select statusid,count(*) cnt table1 statusid=6 grouping statusid having count(*) > 1) tbl )
sql sql-server count
Comments
Post a Comment