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 / bharath

guys rowid concept is discontinued in teradata as far as my
knowledge goes, we can always use below sql ...

INSERT INTO nodupes_table ( all_columns )
SELECT all_columns
FROM dupes_table
QUALIFY ...

where the QUALIFY ... can be (depending on your version):
/* V2R5 syntax */
QUALIFY ROW_NUMBER() OVER (PARTITION BY all_columns
ORDER BY all_columns) = 1

/* or V2R4 and higher equivalent functionality */
GROUP BY all_columns
QUALIFY CSUM(1, all_columns ) = 1

/* or, alternative OLAP SUM V2R4 and higher syntax */
QUALIFY SUM(1) OVER (PARTITION BY all_columns ORDER BY
all_columns ROWS
UNBOUNDED PRECEDING ) = 1


I do think an insert-select into a set table would be a
cleaner process (don't know about runtime, though):
INSERT INTO nodupes_set_table ( all_columns )
SELECT all_columns
FROM dupes_table;


refer to teradata forum for more info

Is This Answer Correct ?    17 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of joins in teradata and what are the available join types?

1024


What is meant by a Clique?

1008


Why is the case expression used in teradata?

1035


Which is more efficient group by or distinct to find duplicates?

1051


How do you do backup and recovery in teradata?

973


Explain some differences between mpp and smp?

1049


What are the enhanced features in teradata v2r5 and v2r6?

1090


What is smp and mpp platforms?

923


What are the joins in teradata and how many types of joins are there in teradata?

976


What are tpump utility limitations?

1079


What is bteq script in teradata?

1098


Describe the set operators in teradata.

963


Can we collect statistics on multiple columns?

1002


What are the functions involved in shared information architecture?

1037


What are the different design perspectives used in teradata?

945