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

Deleting duplicate rows in multiset table - forum topic by mayya@teradataforum

$
0
0

Hi,
I want to delete duplicate record, by keeping only one row for such duplicate records in Multiset table.
Suppose we have 2 rows with values 1, 2, 3 and 1, 2, 3 in my multiset table then after delete i should have only one row i.e. 1, 2, 3.
select * from jedi_mvn_db.zam_multiset
where (col1,col2,col3) in
(select col1,col2,col3 from jedi_mvn_db.zam_multiset group by 1,2,3 having count(*)>1)
qualify row_number() over (partition by col1,col2,col3 order by col1,col2,col3)>1;
above select gives me correct result. But when i convert this select statement into delete statement as below, it gives error "expected something between ")" and qualify keyword.
delete from jedi_mvn_db.zam_multiset
where (col1,col2,col3) in
(select col1,col2,col3 from jedi_mvn_db.zam_multiset group by 1,2,3 having count(*)>1)
qualify row_number() over (partition by col1,col2,col3 order by col1,col2,col3)>1;
I came to know that qualify cannot be used in delete statement.
Is there any way to delete such duplicate records with out using ROWID ?
 

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



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