Hi, I would like to remove an object that doesn’t end ‘00’ and if there are objects that start with the same 4 charcters and ending with 00. All objects ending with 00 shall remain. All object not ending with 00 shall remain of there is no object starting with the same 4 characters and ending with 00 What about: DELETE
FROM
tab
t1
WHERE
right (t1.col,
2) != '00'
AND
EXISTS
(SELECT
1
FROM
tab t2
WHERE
t2.col = left (t1.col,
4) || '00'); It deletes rows where the right two characters are not ‘00’ and another row with the same first four characters and ‘00’ at the end exists. Dirk
|