日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

Sql Server编程

發布時間:2025/7/14 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Sql Server编程 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Sql Server編程

1.注釋語句
?????????單行 --
?????????多行? /*??????????????????? */
2.申明變量
?????????declare @lastname? nvarchar(30),@firstname? nvarchar(20)
3賦值
?????????select @mycounter=20
?????????set @myvar1='this is a test'
???????? set @rows=(select count(*) from authors)
4 if??? else
??????????if (select avg(price) from titler where type="business")<$20
??????????????? begin
????????????????end
??????????else
?????????????? begin
?????????????? end
????????? if? [not] exists (select 語句)?????????????????????? --只要檢測到一條記錄就返回正確結果
????????????????句組1
??????????else
??????????????? 句組2
5while
?????????while not exists(select price from titles where price<$30)
???????????????begin
????????????????????????update titles
????????????????????????set price=price*1.5
????????????????????????select max(price) from titles
????????????????????????if(select?max(price) from titles)>$50
?????????????????????????????????break;
????????????????????????else
?????????????????????????????????continue;
???????????????end
6 case
??????select? "作者"=
??????????????????case? state
????????????????????????when? "ca"? then? "來自加利福尼亞州"
????????????????????????when "ks"???then? "來自印度"
????????????????????????else?? "來自其他州"
????????????????? end
??????from authors? order by state

7? transaction
?????????begin? tran??? [tranname]
?????????commit? [tran]? [tranname]
?????????rollback? [tran]? [tranname]

?????????seve tran? [savepointname]
?????? for example:
??????????? begin? transaction? exampletrans
????????????save? tansaction???percentchanged
????????????rollback?transaction percentchanged
????????????commit??tansaction
????????????
?????????


posted on 2006-10-17 10:47 吳勇 閱讀(...) 評論(...) 編輯 收藏

轉載于:https://www.cnblogs.com/wuyong/archive/2006/10/17/531129.html

總結

以上是生活随笔為你收集整理的Sql Server编程的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。