下面SQL 中的;with 為什么一定要加上':with'呢,起什么作用呢.
下面SQL 中的;with 為什么一定要加上':with'呢,起什么作用呢.
;with
digits (i) as(--set up a set of numbers from 0-9
select i
from (VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) as digits (i))
--builds a table from 0 to 99999
,sequence (i) as (
SELECT D1.i + (10*D2.i) + (100*D3.i) + (1000*D4.i) + (10000*D5.i)
FROM digits AS D1 CROSS JOIN digits AS D2 CROSS JOIN digits AS D3
CROSS JOIN digits AS D4 CROSS JOIN digits AS D5)
select i,nchar(i) as character
from sequence
where i between 48 and 122 --vary to include any characters
--in the character set of choice
order by nchar(i) collate Latin1_General_bin --change to the collation you
--are trying
GO
;with
digits (i) as(--set up a set of numbers from 0-9
select i
from (VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) as digits (i))
--builds a table from 0 to 99999
,sequence (i) as (
SELECT D1.i + (10*D2.i) + (100*D3.i) + (1000*D4.i) + (10000*D5.i)
FROM digits AS D1 CROSS JOIN digits AS D2 CROSS JOIN digits AS D3
CROSS JOIN digits AS D4 CROSS JOIN digits AS D5)
select i,nchar(i) as character
from sequence
where i between 48 and 122 --vary to include any characters
--in the character set of choice
order by nchar(i) collate Latin1_General_bin --change to the collation you
--are trying
GO
英語人氣:187 ℃時間:2020-06-02 11:28:01
優(yōu)質(zhì)解答
SQL 語句里面的 with是使用在 CTE 上面的CTE(Common Table Expression) ,即公用表表達(dá)式,可以認(rèn)為是在單個 SELECT、INSERT、UPDATE、DELETE 或 CREATE ⅥEW 語句的執(zhí)行范圍內(nèi)定義的臨時結(jié)果集.CTE 與派生表類似,具體...
我來回答
類似推薦
- SQL 中with的用法
- 當(dāng)x=____時,代數(shù)式2分之1-x與1-3分之x-1的值相等
- 成語,描述事情不是安照自己的意愿發(fā)展的成語
- 形容老鷹的詞
- 一直關(guān)于x的方程為3x+a=5-6x
- 將250ml密度為1.05g/cm3的質(zhì)量分?jǐn)?shù)為14%的硫酸跟足量的鐵屑充分反應(yīng),求
- 根據(jù)所學(xué)知識對對聯(lián)
- 線性代數(shù):如果n階矩陣A中的所有元素都是1,求出A的所有特征值,并求出A的屬于特征值λ=n的特征向量?
- ( )Chinese are looking forward to learning English well before Beijing Olympics.
- Eggs,though rich in nourishments,have ______ of fat.
- a²-5a-36 分解因式,速求~
- 已知an是首項為19,公差為-2,的等差數(shù)列,sn為an的前n項和 1.求通項an及sn 2.設(shè)(
猜你喜歡
- 1Newton proved that it is ______ the moon is pulled out of a straight path and kept in orbit.
- 2i don,t think it will rain tomorrow,----- ------?
- 3甲.乙兩地相距81千米,小林和小明同時從兩地騎車相向而行,小林每小時行10千米,3小時后兩人相遇.`1`1`1
- 4《床頭上的標(biāo)簽》中李比希為什么懊悔莫及?
- 5英語翻譯
- 6七年級課課大考卷數(shù)學(xué)答案
- 7你根本不健康,所以你必須改變你的飲食的英文是什么?
- 8英語翻譯
- 9已知數(shù)列{an}中,an=4^n-14*2^n-20,n∈N*
- 10A、那樣丑的臉,那樣長的牙,那樣安靜的態(tài)度.他們咀嚼的時候,上牙和下牙交錯地磨來磨去,大鼻孔里冒著熱氣,白沫子粘在胡須上.(駱駝)
- 11有關(guān)“美就在你身邊”的名言
- 12如果1998某人的年齡等于他出生的公元年數(shù)的數(shù)字之和,那么1980年他的年齡是?歲?