How do you eliminate duplicates?

Answers were Sorted based on User's Feedback



How do you eliminate duplicates?..

Answer / yuvaevergreen

yes...the above option can be used if access has been
provided to create set tables.If not, partition by clause
can be used.
1. create table2 as table1 with no data;
2. insert into table2
sel column1,column2,,,columnn from table1
group by 1,2
qualify row_number() over (partition by
column1,column2,,,columnn order by
column1,column2,,,columnn desc) =1
where table1 is with duplicates and table2 would be target
table.

Is This Answer Correct ?    12 Yes 0 No

How do you eliminate duplicates?..

Answer / guest

Let us consider table ‘B’ containing duplicates.


Create a empty table ‘A’ with set option and send the data
from table ‘B’ to table ‘A ‘so that only unique records will
be inserted. Now drop table ’B’ and rename table ‘A’ with
table ‘B’.

Is This Answer Correct ?    8 Yes 0 No

How do you eliminate duplicates?..

Answer / tdguy

Adding to the above,if enough spool space is available, 1.
create a volatile table with the same structure 2. insert
into volatile table
sel column1,column2,,,columnn from table1 group by 1,2
qualify row_number() over (partition by
column1,column2,,,columnn order by
column1,column2,,,columnn desc) =1
3. delete from target table and insert from volatile table.
All the above steps should be done with the same session.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Teradata Interview Questions

Why does varchar occupy 2 extra bytes?

0 Answers  


What is multi insert?

0 Answers  


1.what is activity count? 2.what is skew factor? how it's working explain brefily

5 Answers   Satyam,


Explain teradata architecture?

0 Answers  


Can some one tell me the ressolution for the error. I was not able to answer this question in wipro interview. "The transaction exceeded the maximum number of rowhash locks allowed"

1 Answers   Wipro,


Difference between Qualify and group

4 Answers   CTS,


what is object level locking ? where do appear this type of locking ?

0 Answers  


What are the various indexes in teradata? Why are they preferred?

0 Answers  


Hi Friends I have a sql question, We have the source data as below. 101 address1, address2, address3 and the output shoulb like below 101 address1 101 address2 101 address3 Required a SQL query for this output. Please let me know if you have any sql query for this. Thanks in advance. Hari M

6 Answers   JPMorgan Chase,


Is multi insert ansi standard?

0 Answers  


Different phases of multiload?

0 Answers  


which option is used to restart the fastexport script ?

2 Answers   TCS,


Categories