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

How is MLOAD Teradata Server restarted after execution?

1267


In a table can we use primary key in one column and in another column both unique and not null constrains.if yes how?

1169


What is a dimension table?

1064


What are normalization, first normal form, second normal form and third normal form?

1054


What are the different design perspectives used in teradata?

983


Highlight all the modes that are present under Confidence Level.

971


What type of indexing mechanism do we need to use for a typical data warehouse?

1167


What is the use of fallback?

996


What are the steps involved after the disk manager passes the request?

1121


What can be achieved by using the teradata rdbms?

1038


What is the purpose of upsert command?

1177


What is primary index and secondary index?

1028


What are the design features involved in teradata?

1058


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

984


Did you write stored procedures in teradata?

1132