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 sqldataadapter?

964


What is the difference between count 1 and count (*) in a sql query?

980


what is uncommittable transactions? : Transact sql

992


Which is better join or subquery?

1127


What is the purpose of normalization?

1038


How does rowid help in running a query faster?

1411


How can I get the number of records affected by a stored procedure?

1056


What are the two parts of design view?

1013


Is natural join same as inner join?

922


How to raise user-defined exception with custom sqlerrm ?

1121


what is column? : Sql dba

999


What do you understand by pl/sql cursors?

1080


Can we join two tables without common column?

998


Can we connect to postgresql using sql developer?

993


What is the difference between local and global temporary table?

1035