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


Please Help Members By Posting Answers For Below Questions

What is the difference between delete and truncate statements?

749


Do you know what is user defined datatypes and when you should go for them?

711


What is difference between createstatement and preparedstatement?

794


What is the default fill factor value?

764


Where are SQL server users names and passwords are stored in sql server?

906


Which trace flags are enabled in sql server?

680


What is the difference between resultset and resultsetmetadata?

710


How to delete duplicate rows in sql server?

782


Can group functions be used in the order by clause in ms sql server?

762


Define cursor locking

744


What are the different index configurations a table can have?

692


Which feature in sql server 2008 has surprised you? You can name just one. : sql server database administration

690


what information is maintained within the msdb database? : Sql server administration

702


Write a SQL query to make a column as unique?

782


Can we insert data into a view?

830