sql script: Calculating Days
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迭代器来实现一个斐波纳契数列
推荐阅读
-
MySQL5.7: sql script demo
-
SQL Server: create table sql script
-
可重复执行的SQL Script
-
ApexSQL Log中的Redo Script跟原始SQL不一致问题
-
sql script: Calculating Days
-
关于Oracle DB中SQL Script的注释(REM,--,/* */)
-
SQL*Plus 执行脚本时传递参数(@script_name var1,var2)
-
SQL Tuning Health-Check Script (SQLHC) (文档 ID 1366133.1)
-
sql script: Calculating Days
-
SQL Server: create table sql script