sql script: Calculating Days

WBOY
發布: 2016-06-07 17:43:32
原創
1296 人瀏覽過

T1 (ID INTEGER ) T1 VALUES ( 1 ) x(dy,dm,mth,dw,wk) 7 as ( 8 select dy, 9 day (dy) dm, 10 datepart (m,dy) mth, 11 datepart (dw,dy) dw, (dw,dy)(ww,dy) (ww,dy) 15 end wk 16 from ( (, getdate ()) dy 18 from t1 19 ) x (d, 1 ,dy), day ( dateadd

T1 (ID INTEGER) T1 VALUES (1) x(dy,dm,mth,dw,wk) 7 as( 8 select dy, 9 day(dy) dm, 10 datepart(m,dy) mth, 11 datepart(dw,dy) dw, (dw,dy)(ww,dy)(ww,dy) 15 end wk 16 from( (,getdate()) dy 18 from t1 19 ) x (d,1,dy),day(dateadd(d,1,dy)),mth, 22 datepart(dw,dateadd(d,1,dy)), (dw,(wk,(wk,dateadd(d,1,dy)) x (m,dateadd(d,1,dy))=mth 29 ) (dm end) as Mo, dm end) as Tu, dm end) as We, dm end) as Th, dm end) as Fr, dm end) as Sa, dm end) as Su 37 from x wk wk dy, 43 day(dy) dm, 44 datepart(m,dy) mth, 45 datepart(dw,dy) dw, (dw,dy)(ww,dy)(ww,dy) 49 end wk 50 from( (,getdate()) dy 52 from t1 53 ) x x(dy,dm,mth,dw,wk) 58 as( 59 select dy, 60 day(dy) dm, 61 datepart(m,dy) mth, 62 datepart(dw,dy) dw, (dw,dy)(ww,dy)(ww,dy) 66 end wk 67 from( (,getdate()) dy 69 from t1 70 ) x (d,1,dy), day(dateadd(d,1,dy)),mth, 73 datepart(dw,dateadd(d,1,dy)), (dw,(wk,(wk,dateadd(d,1,dy)) x (m,dateadd(d,1,dy))=mth 80 ) x ,网站空间,网站空间,网站空间

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板