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
What is a trigger? Why we need it?
What is change data capture (cdc) feature?
As per your opinion what are the five top responsibilities of a dba? : sql server database administration
List some major differences between triggers and stored procedures?
Do you know exporting and importing utility?
Differentiate between sql temp table vs table variable?
SQL Server Architecture ?
How to encrypt Strored Procedure in SQL SERVER?
What does the not null constraint do?
code to create procedure for taking databse backup in sql server or i have the query for it but what it's query returns means i want to show on my jsp that the databse backup has been taken on the basis of that return value.does it returns 0 or 1.wat is the code for that
What are recommended options to be used while using db mirroring? : sql server database administration
How to select some specific columns from a table in a query in ms sql server?
What are the different Authentication modes in SQL Server and how can you change authentication mode?
How to concatenate two strings in SQL Server.
Explain about remote stored procedure?