Archives of the TeradataForum
Message Posted: Thu, 08 Dec 2005 @ 08:09:56 GMT
Subj: | | Re: Qualify Clause in Delete Query |
|
From: | | Michael Larkins |
Hello Dinesh:
What if you did something like the following (not tested):
Delete FROM Table1
Where (1, Primary index columns )
IN
(SEL row_number () OVER (partition BY
Primary index columns
Order by column asc)
,Primary index columns
FROM Table1
Where 1 < (SEL count(*) FROM
WHERE table1.column(s) = .column(s) ))
Using a corelated subquery should generater fewer sequential numbers ROW_NUMBER) and only the first one will be deleted.
Hope this helps,
Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor
|