Comments are inline.

Just a friendly reminder, you replied to an existing thread then changed the subject to send this email. So people whose email clients thread messages might not even be seeing your email if they don't look inside the thread you originally replied from.

James wrote:

Method A:
Delete from STORIES where story_id = '1'
Delete from STORIES where story_id = '3'
Delete from STORIES where story_id = '5'


or

Method B:
Delete from STORIES where story_id IN (1,3,5)...I guess this is the same as using OR's


What is the state of the database if the deletion on story_id = '3' fails?
In method A, 1 and 5 are deleted.

That depends on how your application handles the error, which I'm sure you're aware of.


in method B, is only 1 deleted? are 1 and 5 deleted, or are none of them deleted (i.e. MySQl treats this as one unit of work)?


It stops deleting any records when it hits an error. You can use DELETE IGNORE, to ignore the errors and continue deleting records. The order those rows are deleted in is undefined (unless you use an ORDER BY clause). So, if Story 3 was deleted last, you would still have 3 and 5, but if it was first you would have all the records.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to