sspoke Posted September 5, 2007 Share Posted September 5, 2007 i know how to do this now with UPDATE/SELECT's but not im sure why it doesn't compile with DELETE FROM. /** failures */ DELETE FROM `user_invitems` AS l USING `user_credentials` AS c WHERE l.id = c.id AND c.name = 'testing123' DELETE FROM `user_invitems` AS l, `user_credentials` AS c WHERE l.id = c.id AND c.name = 'testing123' DELETE FROM `user_invitems` AS l, `user_credentials` AS c AS l.id = c.id AND c.name = 'testing123' using 2 tables 1 to pick name from and match its id row to a different tables row. also another question relating speed its really odd on the working UPDATE/SELECT which is exactly like DELETE FORM except it works.. for some reason those UPDATE/SELECT process for this took around 0.0130 secs to get id from a different table and do its process which is alot more compared to normal SELECT/UPDATEs on a preset id which are like 0.0020 secs Quote Link to comment Share on other sites More sharing options...
sspoke Posted September 5, 2007 Author Share Posted September 5, 2007 did more research and tried DELETE `user_invitems` FROM `user_invitems` AS l, `user_credentials` AS c WHERE l.id = c.id AND c.name = 'testing123' didn't work.. can't edit topics srry Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 5, 2007 Share Posted September 5, 2007 delete from tablename where field =condition thats all!!!!!! Quote Link to comment Share on other sites More sharing options...
sspoke Posted September 5, 2007 Author Share Posted September 5, 2007 delete from tablename where field =condition thats all!!!!!! No.. I know that.. im talking about SELECT + DELETE in one DELETE. Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 5, 2007 Share Posted September 5, 2007 delete from tablename where fieldtobedeleted in(select form tbale where condition)???? Quote Link to comment Share on other sites More sharing options...
sspoke Posted September 5, 2007 Author Share Posted September 5, 2007 and how can I do what u said? ??? ? DELETE FROM `user_invitems` AS l, `user_credentials` AS c WHERE l.id = c.id IN c.name = 'testing123' ? remember I can't delete user_invitems without only deleting the linked ID's to user_credentials by name.. Quote Link to comment Share on other sites More sharing options...
teng84 Posted September 5, 2007 Share Posted September 5, 2007 do something like a Cartesian join http://dev.mysql.com/doc/refman/5.0/en/delete.html Quote Link to comment Share on other sites More sharing options...
sspoke Posted September 5, 2007 Author Share Posted September 5, 2007 yah thats no help.. at all.. Quote Link to comment Share on other sites More sharing options...
fenway Posted September 7, 2007 Share Posted September 7, 2007 yah thats no help.. at all.. Did you get this figured out? There was a lot of nonsense posted on this thread.... 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.