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

2015-11-21 01:40:51 · 作者: · 浏览: 2
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');

?