Can I do a mysql Select, Update and Delete in one query? -
can 1 of many ways optimize mysql reduce number of queries?
if so, can this:
- select "data" => $a table x - update $a table y - delete $a table x in 1 query?
you can't reduce number of queries - different things - reduce number of round trips database , number of parses wrapping plsql function.
however can't select data after you've deleted it.....but consider:
create procedure s_u_d(a) begin update tab_x set tab_x.avalue=1 tab_x.another=a; delete tab_y tab_y.avalue=a; select * tab_x tab_x.another=a; end; nb - can run multiple selects in same procedure , handle multiple, different shaped result sets, e.g. see page
Comments
Post a Comment