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 are the disadvantages of mysql? : Sql dba

1083


What are the types of subqueries?

1026


What is the reports view in oracle sql developer?

932


What is plpgsql language?

986


what is offset-fetch filter in tsql? : Transact sql

900


What is the basic form of sql query?

891


What is group function in sql?

974


What is the use of desc in sql?

921


Differences between Oracle 9i and 10g (Probably in terms of SQL and PL/SQL)?

3522


what is a field in a database ? : Sql dba

997


How does sql developer connect to oracle database?

958


How do you delete duplicates in sql query using rowid?

902


Explain isolation levels. : Transact sql

1021


What is the advantage of index in sql?

921


How do I count records in sql?

952