Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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.

Answers were Sorted based on User's Feedback



i want only duplicates rows from coloumn ex. emp_id(colomn name)1,1,2,3,3,4,5,5. so i want only ..

Answer / kumar.t

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 ?    17 Yes 2 No

i want only duplicates rows from coloumn ex. emp_id(colomn name)1,1,2,3,3,4,5,5. so i want only ..

Answer / chinna_g

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 ?    9 Yes 1 No

i want only duplicates rows from coloumn ex. emp_id(colomn name)1,1,2,3,3,4,5,5. so i want only ..

Answer / v rajkumar

select Emp_Id from Employee group by Emp_Id having count(*)
>1

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL Server Interview Questions

In which year relase the 7.0& 2000 & 2005?

1 Answers  


write the query for find the top 2 highest salary in sql server

36 Answers   Cranes, Jayanti Software, Medi Assist, Rmax, TCS,


What is 1nf 2nf and 3nf?

0 Answers  


Why we need sql server?

0 Answers  


What is the purpose of self join?

0 Answers  


What is the difference between getdate and sysdatetime?

0 Answers  


What are the advantages of using stored procedures?

0 Answers  


How many types of cursors are there in SQL Server?

5 Answers   247Customer, CarrizalSoft Technologies,


What is difference between view and materialized view?

0 Answers  


How do we get month name in SQL Server 2000, Oracle, MS Access?

11 Answers  


What is the best way to move n number of DTS package from one SQLServer to another SQLServer?

1 Answers   RBS,


What is difference between count (*) and count 1?

0 Answers  


Categories