MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 1130|回复: 1

MYSQL中IF嵌套报错

[复制链接]
发表于 2017-6-12 12:38:35 | 显示全部楼层 |阅读模式
  1. create procedure `test2`
  2. (
  3. IN cusername VARCHAR(50),
  4. IN cpassword VARCHAR(50),
  5. IN clastloginio VARCHAR(50)
  6. )
  7. BEGIN  
  8.     if exists(select * from mt_userlogin where username=cusername) then
  9. --    if exists(select 1) then
  10.         if 1=1 THEN
  11.     select 1;
  12.         ELSE
  13.      select 2;
  14.         end if;
  15.     ELSE   
  16.         select -7,'Username not found';
  17.     end if;
  18. end;
复制代码
只要嵌套一个IF就会报错,网上查了没结果
QQ截图20170612123423.png
 楼主| 发表于 2017-6-12 13:14:33 | 显示全部楼层
有人吗,求帮助
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-4-18 23:59 , Processed in 0.070245 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表