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

One need have atleast a unique column such as timestamp col
(and assumption is to keep lowest tmpstmp) OR some key col
say IPID (again keep lowest value)..

One determined - Have a nested Select on all rows (except
that key col) with group by rest of the columns + having
count(*) > 0 + aggreate MIN(key_col).

Now said that, have another outer SEL on all columsn &
do a inner join with above nested Sel .. WHERE outer
key_col <> MIN value of nested SEL..

See if it works..

Is This Answer Correct ?    5 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to identify ppi columns?

660


how do we write scripts in unix how to execute scripts in real time anybody please needfull or give me number i will cal u

1284


How to Extract data from multiple legacy systems?

576


What do you mean by teradata intellicloud?

603


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

3119






how do you manage the production space. what are the proactive methods you can take ?

1483


What tools would you use for that?

578


What are the different table types supported by teradata?

537


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

579


Why do you get spool space errors? How do trouble-shoot them?

599


How is the teradata different from oracle?

626


How will you solve the problem that occurs during update?

589


what are the uses of fact table and dimension table in banking project?

4108


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

580


How can we check the version of Teradata that we are using currently?

599