Posted by Chris Hope on 06/29/05 00:40
Gordan wrote:
> can somebody explain to me the difference between "TRUNCATE TABLE
> table1" and "DELETE FROM table1 WHERE 1=1"
> I know that both of these queries will delete all rows, and I also
> know that TRUNCATE will reset my auto_increment IDs and DELETE won't.
> Are there any other differences?
I wrote an article about this about a year ago about exactly this (url
below). Note that the behaviors are slightly different depending which
table type and MySQL version you are using.
http://www.electrictoolbox.com/article/mysql/delete-all-data-mysql/
--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Navigation:
[Reply to this message]
|