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

If the job running very slow what is the action you do

1434


Does sql server use java?

525


What is stored in the mssqlsystemresource database? : sql server database administration

598


What are the hotfixes and patches in sql server?

553


Explain what is raid and what are different types of raid levels?

541






Describe different Processing Modes offered by SSRS?

167


What is msdb database? : SQL Server Architecture

547


How to list all stored procedures in the current database using ms sql server?

647


How do I clean up sql server transaction log?

580


What is meant by indexing files?

591


What is sql azure database?

188


How self join is different from outer join?

610


Are null values the same as that of zero or a blank space?

586


How to change the data type of an existing column with "alter table" statements in ms sql server?

536


What is view in sql?

571