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 have a table EMP in which the values will be like this

EmpId Ename Sal DeptId
11 Ram 10000 10
11 Ram 10000 10
22 Raj 20000 20
22 Raj 20000 20
33 Anil 15000 30
33 Anil 15000 30

I want to delete only duplicate Rows. After Delete I want
the output like this

EmpId Ename Sal DeptId
11 Ram 10000 10
22 Raj 20000 20
33 Anil 15000 30



Answers were Sorted based on User's Feedback



I have a table EMP in which the values will be like this EmpId Ename Sal DeptId 11 Ra..

Answer / shankar

Delete FROM EMP where EMPID in (Select max(EMPID) from EMP
Group by EMPID having Count(EMPID)>1)

Is This Answer Correct ?    0 Yes 1 No

I have a table EMP in which the values will be like this EmpId Ename Sal DeptId 11 Ra..

Answer / samadhan

use distinct keywor in sql query

Is This Answer Correct ?    1 Yes 4 No

I have a table EMP in which the values will be like this EmpId Ename Sal DeptId 11 Ra..

Answer / ashim kumar pal

SET rowcount 3

delete distinct * from table

set rowcount 0

select * from table

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More SQL Server Interview Questions

How to change the system date and time from SQL Plus Terminal ?

0 Answers   MCN Solutions,


if a parameter is not send to a stored procedure what type of identifier is to be used in Stp and if that parameter is not feed to the a query inside the Stp how to validate with out useing IF condition

1 Answers   Aviva,


State the difference between local and global temporary tables?

0 Answers  


How to connect to a sql server using odbc_connect()?

0 Answers  


What stored by the msdb?

0 Answers  


Please explain what is “asynchronous” communication in sql server service broker?

0 Answers  


How do you create a data source?

0 Answers  


What is self contained scalar sub query?

0 Answers  


What sql server means?

0 Answers  


please bar with my english i having a database called tblhallreservation in which res_date is date field has to select all the fields in table deponding on month either has to display all details for the month jan or feb and so on

1 Answers  


What will be query used to get the list of triggers in a database?

0 Answers  


What is a view? is View updatable?

17 Answers   IBM, L&T,


Categories