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 maney row would be print after join if A table have 100 rows and B table have 50 rows...
Beginning with sql server version 7 0, a new enhanced data type nchar was added what type of data is supported with this data type?
What is sql sandbox in sql server?
If you want to send some data from access database to sql server database. What are different component of ssis will you use?
What is left outer join in sql server joins?
What is the maximum size of sql server database?
What is trigger ?
What are the source of constraints?
hi, i have a table called names and field name select * from names name a b c d i want to display like this name a,b,c,d how it is possible Regards Baiju
What are the general features of sql server management studio? : sql server management studio
What is SQL server agent?
How you trouble shoot when any job fails
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)