下面是这个存储过程
create procedure delete_restPhoto(restID1 int)
begin
declare charge int;
select restID from restPhoto where restID=restID1 into charge;
if(charge=null) then//当上面restID1在表restPhoto中不存在的时候,我判断charge=null,可是实际上这个IF语句不执行
select 'restID does not exit!';
else
delete from restphoto where restID=restID1;
end if;
end;
还有就是在MYSQL中,我想判断两个变量不相等怎么用啊?"!="和"<>"都没有用
create procedure delete_restPhoto(restID1 int)
begin
declare charge int;
select restID from restPhoto where restID=restID1 into charge;
if(charge=null) then//当上面restID1在表restPhoto中不存在的时候,我判断charge=null,可是实际上这个IF语句不执行
select 'restID does not exit!';
else
delete from restphoto where restID=restID1;
end if;
end;
还有就是在MYSQL中,我想判断两个变量不相等怎么用啊?"!="和"<>"都没有用
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货