![]() |
|
Archives of the TeradataForumMessage Posted: Wed, 17 Aug 2005 @ 21:04:26 GMT
Solution for the example below.
DELETE FROM test a
WHERE a.rowid IN
(SELECT x.rowid as DEL_ROWID FROM
(SELECT a, b, c, MAX(rowid) as MAX_ROWID FROM test
GROUP BY a, b, c
HAVING COUNT(1) > 1) x,
test y
WHERE x.a = y.a
AND x.b = y.b
AND x.c = y.c
AND x.rowid <> MAX_ROWID)
Let me know if this makes any sense. -Sree
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||