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 |
Can an entity have two primary keys?
What is the meaning of resultset type_scroll_insensitive?
How to Handle the exceptions in Sqlsrver 2005??
what is for foreign key ??
4 Answers CarrizalSoft Technologies, Sabic,
What objects does the fn_my_permissions function reports on? : sql server security
wht is normalization?can u explain me in detail?
how many non clustered index in sql server 2008,2010,2012
from the table display the 2nd highest salary? and also the least 2nd salay?
i have a table student like sname ----- ram ram ram raj raj raj i need the output like sname ----- ram raj ram raj ram raj
How do you make a trace?
how many joins we can write if at all we have n no of tables
5 Answers Tanla Solutions, TS,
WHAT OPERATOR PERFORMS PATTERN MATCHING?
2 Answers CarrizalSoft Technologies, CTS,