sql批量刪除數(shù)據(jù) 怎么批量的刪除數(shù)據(jù)庫中的表中的數(shù)據(jù)?
怎么批量的刪除數(shù)據(jù)庫中的表中的數(shù)據(jù)?兩種刪除表內(nèi)容的方法truncate table name;delete from table name where condition;兩種方法的區(qū)別:trunc
怎么批量的刪除數(shù)據(jù)庫中的表中的數(shù)據(jù)?
兩種刪除表內(nèi)容的方法
truncate table name;
delete from table name where condition;
兩種方法的區(qū)別:
truncate,意思是truncate table,可以刪除所有表而不占用資源。優(yōu)點(diǎn)是速度快,缺點(diǎn)是刪除不能恢復(fù),不能按條件刪除。
刪除,即刪除。此操作占用redlog。它具有恢復(fù)速度快、選擇性刪除等優(yōu)點(diǎn),但缺點(diǎn)是刪除速度慢。不建議批量刪除。