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   To Refer this Site to Your Friends   Click Here
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 ?    1 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 ?    1 Yes 0 No
Kumar.t
 
 
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
What is referential integrity and how is it achieved? Adea-Solutions1
What is a Stored Procedure?  5
There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better? HCL1
How to delete particular value in the column of a table.Is it possible or not?if possible give it as in query.  3
Can you create UNIQUE and PRIMARY KEY constraints on computed columns in SQL Server 2000? Infosys1
Using query analyzer, name 3 ways you can get an accurate count of the number of records in a table? eFunds4
Which institute is best for SQL Server 2005 Training?  3
Accidentally i deleted my table. How can i get that table?  2
What's the maximum size of a row?  4
1.what is stored procedure?Its significance with example? 2.Explain about index with syntax and example? plz do reply.........  1
We create an index to fast the search. How it fast the query? Do we write any special keyword with query?  3
what is the diffrence between Snap Shot and Transaction Replication CSC1
What is a Linked Server?  1
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. iFlex2
How to find the date and time of last updated table? Teledata1
how to find number of columns in a table in sql server 2000 and 2005 also Virtusa6
What is a function? Give some example?  1
how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)? Marlabs5
What should we do to copy the tables, schema and views from one SQL Server to another?  3
how to know Who Is Blocking Your SQL Server?  2
 
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