首页 > 数据库技术 > 详细

SQL Server 中的if...else...结构

时间:2015-03-26 13:06:10      阅读:334      评论:0      收藏:0      [点我收藏+]

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 Server 中的if...else...结构

原文:http://blog.csdn.net/yongyu_it/article/details/44646783

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!