plus delete
Racer I., October 18, 2017 - 10:51 am UTC
Hi,
delete from t where rowid NOT IN (
select min(rowid) keep (dense_rank first order by rowid) row_id
from t
group by substr(x,1,5))
or : order by x, rowid
or : order by length(x), rowid
October 18, 2017 - 3:07 pm UTC
Yep. But why the need for the keep clause?
Why the keep?
A reader, October 23, 2017 - 12:09 pm UTC
I believe the original poster is trying to keep every first occurrence of substr(V1, 1, 5). He wants the result from his example to be:
01254T
50300
45662
not:
01254T
45662
October 24, 2017 - 1:42 am UTC
Fair point - I didnt read that from his question but a KEEP or substituting my "count" with "row_number" will do the trick