设为首页 加入收藏

TOP

SQL Server中的if...else...结构
2015-11-21 01:40:51 来源: 作者: 【 】 浏览:1
Tags:SQL Server if...else... 结构
use yuyongTest



--exists:如果查询语句返回至少一行数据则返回true,否则返回false



if exists(select * from student where number=(-1))

print('Y');

else

print('N');



if exists(select * from student where number>=(-1))

print('Y');

else

print('N');

?

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇sql_tuneadvisor的使用 下一篇sql server已超过了锁请求超时时..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: