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

Write a single SQL to delete duplicate records from the a
single table based on a column value. I need only Unique
records at the end of the Query.

Answer Posted / tdguy

creating a new table would be the best option, if all the
field values are same, as far as i know.
CREATE NEW_TABLE AS OLD_TABLE WITH NO DATA;
INSERT INTO NEW_TABLE
SELECT COLUMN1, COLUMN2,COLUMN3 FROM OLD_TABLE
QUALIFY ROW_NUMBER() OVER
(PARTITION BY COLUMN1, COLUMN2,COLUMN3
ORDER BY COLUMN1, COLUMN2,COLUMN3 ASC ) = 1;
DROP TABLE OLD_TABLE;
RENAME NEW_TABLE TO OLD_TABLE;

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the term 'foreign key' related to relational database management system?

969


how many modules are there in telecome domain?how to explain the architecture?

1969


Explain PDE.

1026


how can we analyze the locks ?

2070


What are the various indexes in teradata? How to use them?

967


How many codd's rules are satisfied by teradata database?

1055


What is multi insert?

996


What are the functions of a Parser?

1040


What are the main components of teradata system?

1077


What do high confidence, low confidence and no confidence mean in explain plan?

991


What does sleep function does in fast load?

1073


What is called partitioned primary index (ppi)?

966


What is upsert statement in teradata?

1066


if collect stats but it show low confidence why?

1632


My table got locked during mload due to a failed job. What do I do to perform other operations on it?

1052