mysql - Do I really have to create a temp table? -
just wondering if knows neater way of doing following without creating , dropping table?
create temporary table temp_table select table_one.col1 table_one join table_two on (table_two.col1 = table_one.col1 ) table_one.col2 = $arg1 , table_two.col2= $arg2; update table_two set col3 = $arg3 col1 in ( select col1 temp_table ); drop table temp_table;
you join in update statement.
update table_two, table_one set table_two.col3 = $arg3 table_two.col1=table_one.col1 , table_one.col2 = $arg1 , table_two.col2= $arg2;
Comments
Post a Comment