删除表数据只保留10000行

原文链接: https://blog.csdn.net/dyllove98/article/details/4543536

delete from debug_log a where a.rowid  in 
(
   select rowid from debug_log 
   minus
   select rowid  from debug_log  where rownum <10000  
)

保留10000条,如果有10000条记录的话

 

你可能感兴趣的:(sql,工作,学习)