how can 2 or more queries be executed in one stored procedure.
This example works, but returns results only from first query
Code: Select all
BEGIN
DECLARE lastPayment DOUBLE ;
select payments.payment
from payments
where client = clijentSearch
order by id desc limit 1;
set lastPayment = payment;
select (lastPayment - (sum(table1.quantity * table1.price))) as cashBalance
from table1
where table1.client = clijentSearch;
END