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 / 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 |
Post New Answer View All Answers
What is a user-defined function in the sql server and what is its advantage?
What are orphan records?
What is sql server profiler trace data file?
Why we use functions in sql server?
Explain the difference between primary keys and foreign keys?
How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?
explain the storage models of olap? : Sql server database administration
Where are SQL server users names and passwords are stored in sql server?
How to loop through the result set with @@fetch_status?
What is TDS(Tabular Data Stream) Gateway?
What is the difference between join and inner join?
What do you know about system database? : SQL Server Architecture
What is trace flag in sql server?
What is set nocount on?
Can you explain different types of joins?