免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3109 | 回复: 3
打印 上一主题 下一主题

mysql 流程控制函数哪里出错了? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-11-09 16:54 |只看该作者 |倒序浏览
use test1
go
if rls in(select name from teacher where age=22)
print  as '任老师年龄22岁'
ELSE
print  as '任老师年龄不是22岁'
提示错误如下:

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'go
if rls in(select name from teacher where age=22)
print  as '任老师年' at line 2

论坛徽章:
0
2 [报告]
发表于 2015-11-10 09:16 |只看该作者
怎么没人回复啊。郁闷!

论坛徽章:
0
3 [报告]
发表于 2015-11-10 09:29 |只看该作者
use test1
go
if rls in(select name from teacher where age=22)
print  as '任老师年龄22岁'
ELSE
print  as '任老师年龄不是22岁'
提示错误如下:

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'go
if rls in(select name from teacher where age=22)
print  as '任老师年' at line 2
各位帮忙看看呗谢谢了

论坛徽章:
2
数据库技术版块每日发帖之星
日期:2015-12-12 06:20:00数据库技术版块每日发帖之星
日期:2016-02-05 06:20:00
4 [报告]
发表于 2015-11-13 13:28 |只看该作者

use test1
go
if EXISTS (select 1 from teacher where age=22 and name='rls')
print  as '任老师年龄22岁'
ELSE
print  as '任老师年龄不是22岁'
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP