ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
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.
 Question Submitted By :: Elumalai.k
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
# 1
For Employee table plz use the following Query...

select [empid] from employee group by [empid] 
having count(empid)>1
 
Is This Answer Correct ?    12 Yes 0 No
Vijendra Singh Shakya
 
  Re: 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
# 2
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 ?    3 Yes 0 No
Meher
 
 
 
  Re: 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
# 3
select empid from employee where empid in (select empid 
from employee group by empid having count(empid) > 1)
 
Is This Answer Correct ?    0 Yes 0 No
Rajesh Kumar
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
I have student marks in a student table. I need second highest mark .Then what will the query for this? Wipro23
where do you use Isolations?give me some exmpale?  1
Accidentally i deleted my table. How can i get that table?  4
How do you use DBCC statements to monitor various aspects of a SQL server installation?  1
Difference between Cluster and Non-cluster index? Oracle9
What is the difference between HAVING clause and the WHERE clause?  4
What is the datatype returned by count(*) Asian-CERC18
Different Types of Functions ? Satyam2
What are functions  3
Would it be a good idea to create an index on a table that always contains 10 records? Why or why not?  3
How will oyu test the stored procedure taking two parameters namely first name and last name returning full name?  3
What is difference beteen Migration and Upgrdation? Satyam4
Can store procedure call by user define function in SQL server? HCL6
Can you have a nested transaction? HCL3
what is difference between primary key and Unique  8
explain different types of jions with examples briefly? Zensar3
Assume,there are three tables in a database, Can i have both primary key and foreign key for each table in the same database?  4
Difference between server.transfer and server.execute method?  1
Which is best Subquery (or) joins in sql server? explain why  2
What all db objects can be found in MSDB database of a SQL Server instance? Accenture1
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com