截断条件 [英] Truncate with condition
本文介绍了截断条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
truncate->这将重置整个表,是否可以通过truncate重置特定的记录/检查条件.
truncate ->this resets the entire table, is there a way via truncate to reset particular records/check conditions.
例如:我想重置所有数据并在表中保留过去30天.
For ex: i want to reset all the data and keep last 30 days inside the table.
谢谢.
推荐答案
否,TRUNCATE
是全有还是全无.您可以执行DELETE FROM <table> WHERE <conditions>
,但这会失去TRUNCATE
的速度优势.
No, TRUNCATE
is all or nothing. You can do a DELETE FROM <table> WHERE <conditions>
but this loses the speed advantages of TRUNCATE
.
这篇关于截断条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文