How do you eliminate duplicates?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is collect statistics?
How do you Generate sequence at the time of Display?
What is the use of having index's on table?
Let us say there is a file that consists of 100 records out of which we need to skip the first and the last 20 records. What will the code snippet?
what is sysdba and sysdbc ? which has high priority ?
TCS recently asked this question I have records like below Emp id Empname Salary DateTimestamp 1 AA 6000 20120609:11:30 1 AA 7000 20120609:12:30 1 AA 8000 20120609:01:30 I want to exceute records max timestamp(20120609:01:30)
what is identity columns in teradata
how many modules are there in telecome domain?how to explain the architecture?
Explain about Skew Factor?
What do you mean by teradata intelliflex?
What is spool space? Why do you get spool space errors? How do trouble-shoot them?
The transaction exceeded the maximum number of rowhash locks allowed