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...

how to delete duplicate rows from a specified table(only
single table)
how do you know which join is need to be used

Answer Posted / jas

delete from table_name where rowid > (select min(rowid)
from table_name where a.col_name=b.col_name)

create new_table as select distinct * from table_name;
drop table_name;
create table_name as select * from new_table;
drop new_table;

delete from table_name where rowid not in (select max
(rowid) from table_name where a.col_name=b.col_name)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of <> sql?

985


What is data manipulation language?

1194


What is cursor and why it is required?

1190


How to avoid duplicate records in a query?

1014


What is package in pl sql with an examples?

1047


How to select all records from the table?

1150


Mention what pl/sql package consists of?

1006


explain commit and rollback in mysql : sql dba

1029


How can you load microsoft excel data into oracle? : aql loader

1182


Which kind of parameters cannot have a default value in pl sql?

1158


Can we use commit inside a trigger?

1100


What is the file extension for sql database?

1012


How do rank () and dense_rank () differ?

1053


What are sql functions? Describe the different types of sql functions?

1150


What are different methods to trace the pl/sql code?

1128