在Navicat中操作Mysql数据卡,创建存储过程然后运行的时候直接运行else语句,什么原因,代码如下!
BEGIN#Routinebodygoeshere...#DECLAREnint(10);DECLAREstrVARCHAR(20);IFstr='高'THENselec...
BEGIN
#Routine body goes here...
#DECLARE n int(10);
DECLARE str VARCHAR(20);
IF str='高' THEN
select * from animal WHERE numtest >10;
ELSEIF str='低' THEN
select * from animal where numtest <10;
ELSE
select * FROM animal;
end if;
END 展开
#Routine body goes here...
#DECLARE n int(10);
DECLARE str VARCHAR(20);
IF str='高' THEN
select * from animal WHERE numtest >10;
ELSEIF str='低' THEN
select * from animal where numtest <10;
ELSE
select * FROM animal;
end if;
END 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询