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 difference between delete and truncate commands? : Sql dba

1133


What is sql dialect?

1120


Can we enter data in a table in design view?

969


Is there a way to automate sql execution from the command-line, batch job or shell script?

972


What are the types of dbms?

975


How to pipe multiline string to isql?

1007


What is the difference between microsoft sql and mysql?

962


Define sql delete statement.

1016


Is sql an operating system?

1020


what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba

1063


What are the key differences between SQL and PL SQL?

1215


can sql servers linked to other servers like oracle? : Sql dba

1009


What is full form of rtm?

1008


What is the purpose of normalization?

1042


how to analyze tables with 'mysqlcheck'? : Sql dba

1013