Help with mysql query
Posted on 2015-01-26
Let me first describe about table and table data
table 1 have 2 columns for example
another table has two colomuns as
now what I want to do is by the end of the day take sum of count from table A, and deduct it from table 2 limit, and than move all records into different tables, I have them in bits and pieces but I don't know what would be a single query to do it.
First query : select sum(count) from tablea where id='1';
let's suppose it returns 16
second query would be : update tableb set limit=limit-16 where id='1';
and third query would be
delete from tablea where id=1
I want these three queries to be a single query.