>  기사  >  데이터 베이스  >  sql script: Calculating Days

sql script: Calculating Days

WBOY
WBOY원래의
2016-06-07 17:43:321297검색

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 ,网站空间,网站空间,网站空间

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.