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.
Answers were Sorted based on User's Feedback
Answer / vijendra singh shakya
For Employee table plz use the following Query...
select [empid] from employee group by [empid]
having count(empid)>1
Is This Answer Correct ? | 17 Yes | 0 No |
Answer / 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 |
Answer / 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 |
How can I create a new template for import ? : sql server management studio
What is 4nf in normalization form?
what is the difference between openrowset and openquery?
What is difference between drop truncate and delete?
What should we do to copy the tables, schema and views from one SQL Server to another?
How to avoid cursors?
3 Answers CarrizalSoft Technologies, HP,
How can delete duplicate records in cte in sql server?
What is the difference between for auto and for nested?
Why is the need for data conversion transformations?
What are the different types of collation sensitivity?
Explain raiserror in sql server?
where do you use Isolations?give me some exmpale?