I know its possible to select nth row.
For example
select from table limit 1 offset 3;
Is it possible to delete nth row?
I know its possible to select nth row.
For example
select from table limit 1 offset 3;
Is it possible to delete nth row?
If you have an id and something to order by and/or partition by you can delete using row_number() like so:
drop table if exists t;
create table t (id int, val int);
insert into t values (1,9),(2,8),(3,7),(4,6),(5,5);
delete
from t
where id in (
select id
from (
select id, row_number() over (order by val asc) as rn
from t
) s
where s.rn = 3);
select * from t;
rextester demo: http://rextester.com/XJHB50704
returns:
+----+-----+
| id | val |
+----+-----+
| 1 | 9 |
| 2 | 8 |
| 4 | 6 |
| 5 | 5 |
+----+-----+