db2 delete如何删除前多少行
答案:3 悬赏:80 手机版
解决时间 2021-11-11 22:36
- 提问者网友:愿为果
- 2021-11-11 16:24
db2 delete如何删除前多少行
最佳答案
- 五星知识达人网友:詩光轨車
- 2021-11-11 16:52
delete from
(select * from t fetch first 10 rows only)
或
delete from t where id in (select id from t fetch first 10 rows only)
(select * from t fetch first 10 rows only)
或
delete from t where id in (select id from t fetch first 10 rows only)
全部回答
- 1楼网友:有你哪都是故乡
- 2021-11-11 18:49
删除前几行?最好选个主键 然后order by 一下。
delete from t where 主键 in (select 主键 from t order by 主键 fetch first 10 rows only)
delete from t where 主键 in (select 主键 from t order by 主键 fetch first 10 rows only)
- 2楼网友:北城痞子
- 2021-11-11 17:37
delete from (
select rownumber()over() as xh
from table_name
) as t
where xh<100
select rownumber()over() as xh
from table_name
) as t
where xh<100
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯