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 / meher

If you want to get the count for the duplicates then, the
query will be:

SELECT EMPID,COUNT(EMPID) FROM EMPLOYEE GROUP BY EMPID
HAVING COUNT(EMPID)>1

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can sql injection be stopped? : sql server security

547


How would you choose between a clustered and a non-clustered index?

543


what are the three command line utilities and what are their primary functions?

101


How to count groups returned with the group by clause in ms sql server?

556


How ssrs maintain security?

579






How to execute multiple stored procedures at one time in sql server?

504


What are the types of sql server?

517


Differentiate between a having clause and a where clause.

521


How do database indexes work?

542


How to stop log file growing too big?

573


What is the difference between deallocate cursor and close cursor?

717


How to connect ms access to sql servers through odbc?

548


Where are sql server user names and passwords stored in sql server?

531


What different steps will a sql server developer take to secure sql server?

500


What will be query used to get the list of triggers in a database?

545