用sql 生成2016年全年的日期

select to_char(日期,‘yyyy-mm-dd‘) from( select to_date(‘2016-01-01‘,‘yyyy-mm-dd‘) + level 日期 from dual
connect by level <=to_date(‘2016-12-31‘,‘yyyy-mm-dd‘)-to_date(‘2016-01-01‘,‘yyyy-mm-dd‘));

结果:

"日期"
"2016-01-02"
"2016-01-03"
"2016-01-04"
"2016-01-05"
"2016-01-06"
"2016-01-07"
"2016-01-08"
"2016-01-09"
"2016-01-10"
"2016-01-11"
"2016-01-12"
"2016-01-13"
"2016-01-14"
"2016-01-15"
"2016-01-16"
"2016-01-17"
"2016-01-18"
"2016-01-19"
"2016-01-20"
"2016-01-21"
"2016-01-22"
"2016-01-23"
"2016-01-24"
"2016-01-25"
"2016-01-26"
"2016-01-27"
"2016-01-28"
"2016-01-29"
"2016-01-30"
"2016-01-31"
"2016-02-01"
"2016-02-02"
"2016-02-03"
"2016-02-04"
"2016-02-05"
"2016-02-06"
"2016-02-07"
"2016-02-08"
"2016-02-09"
"2016-02-10"
"2016-02-11"
"2016-02-12"
"2016-02-13"
"2016-02-14"
"2016-02-15"
"2016-02-16"
"2016-02-17"
"2016-02-18"
"2016-02-19"
"2016-02-20"
"2016-02-21"
"2016-02-22"
"2016-02-23"
"2016-02-24"
"2016-02-25"
"2016-02-26"
"2016-02-27"
"2016-02-28"
"2016-02-29"
"2016-03-01"
"2016-03-02"
"2016-03-03"
"2016-03-04"
"2016-03-05"
"2016-03-06"
"2016-03-07"
"2016-03-08"
"2016-03-09"
"2016-03-10"
"2016-03-11"
"2016-03-12"
"2016-03-13"
"2016-03-14"
"2016-03-15"
"2016-03-16"
"2016-03-17"
"2016-03-18"
"2016-03-19"
"2016-03-20"
"2016-03-21"
"2016-03-22"
"2016-03-23"
"2016-03-24"
"2016-03-25"
"2016-03-26"
"2016-03-27"
"2016-03-28"
"2016-03-29"
"2016-03-30"
"2016-03-31"
"2016-04-01"
"2016-04-02"
"2016-04-03"
"2016-04-04"
"2016-04-05"
"2016-04-06"
"2016-04-07"
"2016-04-08"
"2016-04-09"
"2016-04-10"
"2016-04-11"
"2016-04-12"
"2016-04-13"
"2016-04-14"
"2016-04-15"
"2016-04-16"
"2016-04-17"
"2016-04-18"
"2016-04-19"
"2016-04-20"
"2016-04-21"
"2016-04-22"
"2016-04-23"
"2016-04-24"
"2016-04-25"
"2016-04-26"
"2016-04-27"
"2016-04-28"
"2016-04-29"
"2016-04-30"
"2016-05-01"
"2016-05-02"
"2016-05-03"
"2016-05-04"
"2016-05-05"
"2016-05-06"
"2016-05-07"
"2016-05-08"
"2016-05-09"
"2016-05-10"
"2016-05-11"
"2016-05-12"
"2016-05-13"
"2016-05-14"
"2016-05-15"
"2016-05-16"
"2016-05-17"
"2016-05-18"
"2016-05-19"
"2016-05-20"
"2016-05-21"
"2016-05-22"
"2016-05-23"
"2016-05-24"
"2016-05-25"
"2016-05-26"
"2016-05-27"
"2016-05-28"
"2016-05-29"
"2016-05-30"
"2016-05-31"
"2016-06-01"
"2016-06-02"
"2016-06-03"
"2016-06-04"
"2016-06-05"
"2016-06-06"
"2016-06-07"
"2016-06-08"
"2016-06-09"
"2016-06-10"
"2016-06-11"
"2016-06-12"
"2016-06-13"
"2016-06-14"
"2016-06-15"
"2016-06-16"
"2016-06-17"
"2016-06-18"
"2016-06-19"
"2016-06-20"
"2016-06-21"
"2016-06-22"
"2016-06-23"
"2016-06-24"
"2016-06-25"
"2016-06-26"
"2016-06-27"
"2016-06-28"
"2016-06-29"
"2016-06-30"
"2016-07-01"
"2016-07-02"
"2016-07-03"
"2016-07-04"
"2016-07-05"
"2016-07-06"
"2016-07-07"
"2016-07-08"
"2016-07-09"
"2016-07-10"
"2016-07-11"
"2016-07-12"
"2016-07-13"
"2016-07-14"
"2016-07-15"
"2016-07-16"
"2016-07-17"
"2016-07-18"
"2016-07-19"
"2016-07-20"
"2016-07-21"
"2016-07-22"
"2016-07-23"
"2016-07-24"
"2016-07-25"
"2016-07-26"
"2016-07-27"
"2016-07-28"
"2016-07-29"
"2016-07-30"
"2016-07-31"
"2016-08-01"
"2016-08-02"
"2016-08-03"
"2016-08-04"
"2016-08-05"
"2016-08-06"
"2016-08-07"
"2016-08-08"
"2016-08-09"
"2016-08-10"
"2016-08-11"
"2016-08-12"
"2016-08-13"
"2016-08-14"
"2016-08-15"
"2016-08-16"
"2016-08-17"
"2016-08-18"
"2016-08-19"
"2016-08-20"
"2016-08-21"
"2016-08-22"
"2016-08-23"
"2016-08-24"
"2016-08-25"
"2016-08-26"
"2016-08-27"
"2016-08-28"
"2016-08-29"
"2016-08-30"
"2016-08-31"
"2016-09-01"
"2016-09-02"
"2016-09-03"
"2016-09-04"
"2016-09-05"
"2016-09-06"
"2016-09-07"
"2016-09-08"
"2016-09-09"
"2016-09-10"
"2016-09-11"
"2016-09-12"
"2016-09-13"
"2016-09-14"
"2016-09-15"
"2016-09-16"
"2016-09-17"
"2016-09-18"
"2016-09-19"
"2016-09-20"
"2016-09-21"
"2016-09-22"
"2016-09-23"
"2016-09-24"
"2016-09-25"
"2016-09-26"
"2016-09-27"
"2016-09-28"
"2016-09-29"
"2016-09-30"
"2016-10-01"
"2016-10-02"
"2016-10-03"
"2016-10-04"
"2016-10-05"
"2016-10-06"
"2016-10-07"
"2016-10-08"
"2016-10-09"
"2016-10-10"
"2016-10-11"
"2016-10-12"
"2016-10-13"
"2016-10-14"
"2016-10-15"
"2016-10-16"
"2016-10-17"
"2016-10-18"
"2016-10-19"
"2016-10-20"
"2016-10-21"
"2016-10-22"
"2016-10-23"
"2016-10-24"
"2016-10-25"
"2016-10-26"
"2016-10-27"
"2016-10-28"
"2016-10-29"
"2016-10-30"
"2016-10-31"
"2016-11-01"
"2016-11-02"
"2016-11-03"
"2016-11-04"
"2016-11-05"
"2016-11-06"
"2016-11-07"
"2016-11-08"
"2016-11-09"
"2016-11-10"
"2016-11-11"
"2016-11-12"
"2016-11-13"
"2016-11-14"
"2016-11-15"
"2016-11-16"
"2016-11-17"
"2016-11-18"
"2016-11-19"
"2016-11-20"
"2016-11-21"
"2016-11-22"
"2016-11-23"
"2016-11-24"
"2016-11-25"
"2016-11-26"
"2016-11-27"
"2016-11-28"
"2016-11-29"
"2016-11-30"
"2016-12-01"
"2016-12-02"
"2016-12-03"
"2016-12-04"
"2016-12-05"
"2016-12-06"
"2016-12-07"
"2016-12-08"
"2016-12-09"
"2016-12-10"
"2016-12-11"
"2016-12-12"
"2016-12-13"
"2016-12-14"
"2016-12-15"
"2016-12-16"
"2016-12-17"
"2016-12-18"
"2016-12-19"
"2016-12-20"
"2016-12-21"
"2016-12-22"
"2016-12-23"
"2016-12-24"
"2016-12-25"
"2016-12-26"
"2016-12-27"
"2016-12-28"
"2016-12-29"
"2016-12-30"
"2016-12-31"

时间: 2024-10-10 02:01:02

用sql 生成2016年全年的日期的相关文章

SQL Server 2016 CTP2.3 的关键特性

SQL Server 2016 CTP2.3 的关键特性 数据库方面的增强 Row Level Security已经支持In-memory OLTP 表.用户现在可以对内存优化表实施row-level security策略. 另外SCHEMABINDING.predicate 函数和内联表值函数都要包含NATIVE_COMPILATION编译选项. 使用NATIVE_COMPILATION编译选项的UDFs用户定义函数可以在本地模块和交换查询中使用,就像内存优化表和磁盘表. 没有使用NATIVE

SQL Server -&gt;&gt; 深入探讨SQL Server 2016新特性之 --- Temporal Table(历史表)

原文:SQL Server ->> 深入探讨SQL Server 2016新特性之 --- Temporal Table(历史表) 作为SQL Server 2016(CTP3.x)的另一个新特性,Temporal Table(历史表)记录了表历史上任何时间点所有的数据改动.Temporal Table其实早在ANSI SQL 2011就提出了,而SAP HANA, DB2和Oracle早已在它们的产品中加入/实现了这一特性.所以说微软其实是落后了几个竞争对手.既然在CTP3.0中加入了,相信

在SQL Server 2016里使用查询存储进行性能调优

作为一个DBA,排除SQL Server问题是我们的职责之一,每个月都有很多人给我们带来各种不能解释却要解决的性能问题. 我就多次听到,以前的SQL Server的性能问题都还好且在正常范围内,但现在一切已经改变,SQL Server开始糟糕, 疯狂的事情不能解释.在这个情况下我介入,分析下整个SQL Server的安装,最后用一些神奇的调查方法找出性能问题的根源. 但很多时候问题的根源是一样的:所谓的计划回归(Plan Regression),即特定查询的执行计划已经改变.昨天SQL Serv

SQL Server -&gt;&gt; SQL Server 2016新特性之 -- Dynamic Data Masking

Dynamic Data Masking是为了防止敏感数据暴露给未经授权的用户,以一种最小开销和维护成本的形式.Dynamic Data Masking用于表的字段,相当于盖住字段数据的一部分.比如一些像邮件或者工资这样敏感的数据,涉及PII的,我们可以运用这个功能.运用这个功能的步骤,首先先定义一组人(database role)可以拥有看数据的权限,然后GRANT UNMASK权限给这个角色组.微软提供了4种类型的masking给我们选择:default,email,random和custo

SQL Server 2016的数据库范围内的配置

SQL Server 2016真的让人眼前一亮.几天前微软就提供了RCO(候选发布版)版本的下载.我已经围观了一圈RCO版本,其中一个最拽的功能是数据库范围内的配置(Database Scoped Configuration),在今天的文章里我想谈谈它.补充几句:装好之后,居然发现没有SSMS,崩溃中,原来是在向导中就有独立的安装程序,好吧! 这配色,真是低调有内涵. 另外,如过你的电脑已经安装了就[Microsoft Visual Studio 2010 Shell(独立)Redistribu

MCSA 70-761 SQL Server 2016 练习题搬运

原网站链接:http://www.accelerated-ideas.com/aiMExamsChoose.aspx#mcse 为了方便下次看的时候一眼就理解,顺手加上了粗略翻译. 1. Your team is developing a database for a new online travel application. You need to design tables and other database objects to support the application. One

下载:SQL Server 2016 CTP3 (x64) - DVD (English)

如题: 下载地址,请看文章底部. SQL Server 2016 CTP3 (x64) - DVD (English)ISO English Release Date: 10/30/2015 Details No product key is required. Download 2649 MB File Name:en_sql_server_2016_ctp3_x64_dvd_7213912.isoLanguages:EnglishSHA1:BF0FDF34B5A4BA9660C6CDB70E

SQL Server 2016 AlwaysOn 安装及配置介绍

SQL Server 2016  AlwaysOn 安装及配置介绍 Always On 可用性组功能是一个提供替代数据库镜像的企业级方案的高可用性和灾难恢复解决方案. SQL Server 2012 中引入了 Always On 可用性组功能,此功能可最大程度地提高一组用户数据库对企业的可用性. "可用性组" 针对一组离散的用户数据库(称为"可用性数据库" ,它们共同实现故障转移)支持故障转移环境. 一个可用性组支持一组读写主数据库以及一至八组对应的辅助数据库. (

Windows Server2016+SQL Server 2016 Cluster安装及配置

Windows Server2016+SQL Server 2016 Cluster 安装及配置 我们知道,近期微软正式发布了Windows Server2016和SQL Server Cluster 2016,所以借此机会来尝试一下Windows Server2016+SQL Server Cluster 2016安装及配置,对于相关功能的优化及升级需要在官网上自己查看整理.大概就是windows server2016跟windows10页面框架结构差不多,SQL Server2016从安装上