1. 程式人生 > >mySQL儲存過程怎樣執行多條語句?

mySQL儲存過程怎樣執行多條語句?

create procedure getResult(
in name varchar(30),
in classNames varchar(30)
)
begin
select userName from lxlog where userName=name;
select className from lxuser where className=classNames;
select sum(validTime) as onePersonValidTime from lxlog where userName=name;
select sum(validTime) as classValidTime from lxlog where userName in (select userName from lxuser where className =classNames);
end

call getResult('person','3class')     .