Update Statement To Not Use A Subquery
Posted by:
Justin Keller ()
Date: November 13, 2009 05:47PM
I have the following:
UPDATE transactions SET out_id = 50, project_id = 100 WHERE id = (SELECT transaction_id FROM users_current_transaction WHERE user_id = 1);
Reading from Google it appears the use of correlated sub-queries is VERY naughty because of performance reasons. How would I rewrite the above to not use a sub-query for the update? Thanks.
Edited 1 time(s). Last edit at 11/13/2009 05:52PM by Justin Keller.
Sorry, only registered users may post in this forum.
© 1995-2008 MySQL AB, 2008- Sun Microsystems, Inc.