0print 大 --begin end結(jié)構(gòu)begin end用途 設(shè)定一個程序塊,進(jìn)行批處理if 1>0beginprint 大 end--case 語句 有返回值declare @a int ,@b c..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

SqlServer系列筆記——流程控制語句

發(fā)布時間:2020-08-10 21:41:04 來源:網(wǎng)絡(luò) 閱讀:371 作者:codejson 欄目:數(shù)據(jù)庫

--if else 

if 1>0

print '大'


--begin end結(jié)構(gòu)

begin end用途 設(shè)定一個程序塊,進(jìn)行批處理

if 1>0

begin

print '大'

end

--case 語句 有返回值

declare @a int ,@b char(10)

set @a=1

set @b=case 

when @a>0

then '大于零'

when @a<0

then '小于零'

else

    '等于零'

end

print @b

--while 循環(huán)

--和C#一樣可以使用 break和continue關(guān)鍵字控制循環(huán)的執(zhí)行

declare @a int 

set @a=0

while @a<10

begin 

set @a=@a+1

if @a=4

break

else

print @a

continue

end


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI