欢迎投稿

今日深度:

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

SQL Server 中的if...else...结构,sqlif...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'); 

 

www.htsjk.Com true http://www.htsjk.com/shujukunews/7142.html NewsArticle SQL Server 中的if...else...结构,sqlif...else.. use yuyongTest --exists: 如果查询语句返回至少一行数据则返回 true, 否则返回 false if exists( select * from student where number =(- 1 )) print ( 'Y' ); else print ( 'N...
评论暂时关闭