Archives of the TeradataForum
Message Posted: Wed, 05 May 2004 @ 19:43:26 GMT
Subj: | | Re: Deleting Duplicates with a single DELETE statement |
|
From: | | Thyagarajan, Vivek |
Guys,
Thanks for all your response.
I never knew that I could use ROWID in Teradata. That's what I use all the time in Oracle.
Below is my SQL which deletes all duplicates:
delete from vthyagar.Inv_Header a
where a.rowid
>(
select min(b.rowid)
from vthyagar.Inv_Header b
where a.Invoice_Nbr=b.Invoice_Nbr
and a.Company_Cd=b.Company_Cd)
;
|