0
create procedure insert_income(@title varchar(45),@category varchar(45),@amount float,@date `datetime,@type varchar(45))
as
begin
declare @id int(11)
declare @bal int(11)
set @id= select max(id) from income;
set @bal=select balance from income where [email protected];
if(@category='INCOME')
begin
set @[email protected][email protected]
insert into income values(@title,@date,@category,@amount,@bal,@type)
end
else
begin
if(@category='EXPENSES')
begin
set @[email protected]@amount
insert into income values(@title,@date,@category,@amount,@bal,@type)
end
end
end
我寫的程序的Microsoft SQL Server 2008現在我需要在MYSQL寫這篇存儲過程與參數在mysql中
你嘗試在'MySQL'?你有錯誤?張貼他們也是。 –