You are here: Re: truncate table vs delete from table « PHP SQL « IT news, forums, messages
Re: truncate table vs delete from table

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация