employee table has employee id
-----------
empid
----------------
1
2
3
3
3
4
5
5
5
6
6
6
7
here the values r repeated two times.how to select the
repeated values only.i.e 3,5,6 should alone come.

Answer Posted / rajesh kumar

select empid from employee where empid in (select empid
from employee group by empid having count(empid) > 1)

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of floor function in sql server?

546


What are the benefits of filtered indexes?

509


What is the sql case statement used for? Explain with an example?

538


Define Business Edition in SQL Azure?

88


What is database replication?

578






What happens if null values are involved in comparison operations?

543


Explain what is lock escalation?

575


What is the recovery model?

560


How to call a function from a stored procedure in SQL Server ?

548


What is view in sql?

562


How to drop an existing user defined function in ms sql server?

564


What command do we use to rename a database?

613


What is change data capture (cdc) feature?

586


explain declarative management framework (dmf) in sql server 2008?

580


What are the encryption mechanisms in sql server?

576