GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   MySQL question regarding truncating tables. (https://gfy.com/showthread.php?t=1005884)

Angry Jew Cat - Banned for Life 01-13-2011 09:33 AM

MySQL question regarding truncating tables.
 
Can you Truncate a table with a WHERE clause, and remove only elements which match a certain criteria? Or is TRUNCATE simply used to wipe the entire table?

k0nr4d 01-13-2011 09:41 AM

truncate wipes entire table, you want delete.
DELETE FROM `tablename` WHERE foo = 'bar'

Angry Jew Cat - Banned for Life 01-13-2011 09:48 AM

Quote:

Originally Posted by k0nr4d (Post 17841732)
truncate wipes entire table, you want delete.
DELETE FROM `tablename` WHERE foo = 'bar'

cheers....

grumpy 01-13-2011 10:21 AM

stay away from mysql if you dont know the difference between del and truncate

Angry Jew Cat - Banned for Life 01-13-2011 10:54 AM

Quote:

Originally Posted by grumpy (Post 17841860)
stay away from mysql if you dont know the difference between del and truncate

did you stay away when you didn't know? get bent...

blackmonsters 01-13-2011 10:57 AM

NoSQL FTW!!!


All times are GMT -7. The time now is 06:37 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123