Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Sql to delete duplicates in Teradata - response (14) by Jacobz

$
0
0
Hi, Did anyone get the exact solution for this?. When I have gone through all the statements above I couldnt see the correct one! Let me start from the top, Please correct me if I'm wrong, @emilwu I dont think we can use ordered analytical functions in the where clause. what naveen told is correct it seems. Instead of where clause we should use qualify() @Vador I think you are correct in statement but Select ...... From Qualify row_number() over( partition by order by )=1   this gives all records except the duplicates, almost equivalent to using distinct clause which wont helps the requirement. @sk73 The query is absolutely correct but it also wont meet the requirement. it just selects but on applying the delete it will delete all records having duplicates. @BdeTheije The logic is absolutely correct  but your query straightway selects the distinct records using intermediate table but the requirement is we are not supposed to use it right? So if anyone got the correct answer please update us here Thanks!  Joe                    

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>