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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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
i want only duplicates rows from coloumn
ex. emp_id(colomn name)1,1,2,3,3,4,5,5.

so i want only duplicates no. 
       
 Question Submitted By :: Ravindra Nhavi
I also faced this Question!!     Rank Answer Posted By  
 
  Re: i want only duplicates rows from coloumn ex. emp_id(colomn name)1,1,2,3,3,4,5,5. so i want only duplicates no.
Answer
# 1
You have 'emp' table with empid,empname,empsal.
With values:
1 row:1,'hhh',10000
2 row:2,'nnn',10000
3 row:3,'vvv',15000
4 row:4,'jjj',10000

A)
In this table you have sal column 10000 repeating 3 times 
in the table, if you want to retrieve the repeated values 
i.e. the salary column with 3 times to be displayed in the 
following query:

"select empsal from emp where empsal in(select empsal from 
emp group by empsal having count(empsal)>1);"
 
Is This Answer Correct ?    5 Yes 1 No
Chinna_g
 
  Re: i want only duplicates rows from coloumn ex. emp_id(colomn name)1,1,2,3,3,4,5,5. so i want only duplicates no.
Answer
# 2
Select Emp_Id, Count(Emp_Id) From Employee As Emp
Group By Emp_Id
Having Count(Emp_Id)>1


By 
Kumar
 
Is This Answer Correct ?    7 Yes 1 No
Kumar.t
 
 
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What are the type of Indexes? which one is best, why?  5
What are the steps you will take to improve performance of a poor performing query? HCL1
what is difference between primary key and Unique  8
I am having table Title with TITLE id,Author ID, Publiser ID , table AUTHOR with Author ID, Author Name, table PUBLISER with Pub ID, Pub name Here hot to find out the publiser id who have relesed the books of patriticular author?  3
how to update a null value field in sql server eg a table contains 3 fields id,name,salary and 3 records salary of 1 record is null i want update the nullfield 111 arun 300 112 ddd 200 113 ttt null i want to update table with add 100 to every record include null after updation the recrds should be 111 arun 400 112 ddd 300 113 ttt 100 HCL6
What is the difference between two queries: 1. SELECT * FROM table WHERE 1=1; 2. SELECT * FROM table HP15
Can I know,how to Execute Funcion and Trigger through command(Manualy Execution) in MS SQL/SERVER 2005,give me answer with Example.  1
What is the difference between Userdefined function and stored procedure? Explain and give the example also  4
how do u do Performance tunning ? Satyam1
What is a transaction and what are ACID properties? IBM4
is there more the two primary key in a single table? Systematix22
how to find number of columns in a table in sql server 2000 and 2005 also Virtusa7
How do you use DBCC statements to monitor various aspects of a SQL server installation?  1
What are the two types of concurrency?  2
What is Report Server,Report Manager and Report Builder in SSRS 2005?  1
Explain Active/Active and Active/Passive cluster configurations?  1
About DTS usage ? Cognizent2
How do you check the performance of a query and how do you optimize it?  1
What is a stored procedure?  3
what is the out put of below queries? a. select * from Emp where null = null; b. select * from Emp where 1=1; Patni9
 
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