Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 count repeting records

Author  Topic 

sqllover
Constraint Violating Yak Guru

338 Posts

Posted - 2007-01-12 : 01:31:54
hi, i have 10 records in my column empno in my table as follows:

records are
1,5,8,9,1,7,4,8,9,5.i want to show the repeting records and how many times it is repeted ie count
please give me query for this.

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2007-01-12 : 01:48:19
select empno, count(1) from yourtable group by empno


Duane.
Go to Top of Page

madhuotp
Yak Posting Veteran

78 Posts

Posted - 2007-01-12 : 01:52:17

select EmpNo,Count(*) from Employee group by EmpNo having count(*)>1
Go to Top of Page
   

- Advertisement -