atomicrabbit Posted September 14, 2008 Share Posted September 14, 2008 ok i'm trying to delete multiple entries from multiple tables. In this specific case, I want to delete all specified entries from mw_users and mw_companies (which most likely will exist), but delete the entries from mw_orders ONLY if they exist. Using OR instead of AND deletes ALL values from ALL three tables. DELETE mw_users, mw_companies, mw_orders FROM mw_users, mw_companies, mw_orders WHERE mw_users.company_id IN ('27','28') AND mw_companies.id IN ('27','28') AND mw_orders.company_id IN ('27','28') Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 14, 2008 Share Posted September 14, 2008 I'm of opinion that deleting from multiple tables should be performed by multiple queries Quote Link to comment Share on other sites More sharing options...
atomicrabbit Posted September 14, 2008 Author Share Posted September 14, 2008 but is what I want to do possible? Quote Link to comment Share on other sites More sharing options...
fenway Posted September 15, 2008 Share Posted September 15, 2008 but is what I want to do possible? Yes, it should have worked. Quote Link to comment Share on other sites More sharing options...
atomicrabbit Posted September 16, 2008 Author Share Posted September 16, 2008 dunno why it didn't. I decided to just use separate queries Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.