When do we use the DELETE
command versus the TRUNCATE
command? I am trying to find on the Internet but both commands delete the data; I can't tell the difference.
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- php PDO::FETCH_ASSOC doesnt detect select after ba
- sqlyog export query result as csv
DELETE FROM TABLE
TRUNCATE TABLE
DELETE and TRUNCATE both can be rolled back when used with TRANSACTION. If there is a primary key with auto increment, truncate will reset the counter.