原文:SQL点滴6-"微软不认识闰年2月29日"&字符"N"的作用 http://www.cnbeta.com/articles/50580.htm这个网页新闻中报告许多微软软件不能识别闰年的2月29号 ,其中就包含SQL Server 2008,本人就在自己的SQL Server 2008中写了几个语句试验,这几个语句显示能得到2月29号这一天,不知道照这则新闻所说在这一天安装软件会不会导致错误. select DATEADD(DD,1,'28/Feb/2…
前言: 上次写了查询5天之内过生日的同事中的跨年问题的解决过程,网址为:http://blog.csdn.net/mchdba/article/details/38952033 ,当中漏了一个闰年2月29日生日的细节问题,如今补充一下这个问题的处理过程: 5,补充闰年推断 有朋友提醒,闰年2月29日生日的话,可能查询不到,想到确实没有考虑到这个特殊的日期.5.1,准备測试数据SQL,包括1980-02-29这一天生日的朋友.INSERT INTO ali_users  SELECT 'Jeff'…
SQL Server返回DATETIME类型的年.月.日,有两种方法,如下所示: DECLARE @now DATETIME=GETDATE() --第一种方法 SELECT @now,YEAR(@now),MONTH(@now),DAY(@now),DATEPART(HH,@now),DATEPART(MI,@now),DATEPART(SS,@now),DATEPART(MS,@now) --第二种方法 SELECT @now,DATEPART(YYYY,@now),DATEPART(MM,…
之前一直有在关注微软认证的一些消息,由于最新的SQL Server认证加入了2016的相关内容,导致课程资料需要大部分更新,但是微软更新相对比较慢,并且经常改版,目前发现的最新的MCP Cert Path为2017年5月22日版.所以需要不定时翻阅相关站点查看最新情况,这里把目前最新的情况述说一下,有感兴趣的可以收藏一下. 先简单介绍一下,Microsoft SQL Server认证旨在证明您在设计.构建和维护新一代云就绪数据库和信息解决方案方面的知识和技能. 对于SQL Server认证来说,…
分类: SQL Server  select GETDATE() as '当前日期',DateName(year,GetDate()) as '年',DateName(month,GetDate()) as '月',DateName(day,GetDate()) as '日',DateName(dw,GetDate()) as '星期',DateName(week,GetDate()) as '周数',DateName(hour,GetDate()) as '时',DateName(minute…
计算到某年为止的闰年数,其实很简单.设要计算的年为A,则到A年为止(含A年)的闰年数为: 闰年数=INT(A/)-INT(A/)+INT(A/) 这里:INT为取整数函数 #include <cstdio> #include <cstring> #include <vector> using namespace std; ; ][]={"January", "February", "March", "…
触发器(trigger):当有关联操作的时候使用(级联操作),属于ddl关键字. eg:下订单时,创建中的商品数量要减少:退票时,总的票数要增加.         在订单上建立触发器                             在订单票上建立触发器   (确定要将触发器建立在哪个表上)   after 和 instead of: after:  after insert,after update,after delete                 instead of:inst…
#1094 : Lost in the City 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Little Hi gets lost in the city. He does not know where he is. He does not know which direction is north. Fortunately, Little Hi has a map of the city. The map can be considered as a gri…
#1094 : Lost in the City 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Little Hi gets lost in the city. He does not know where he is. He does not know which direction is north. Fortunately, Little Hi has a map of the city. The map can be considered as a gri…
#1103 : Colorful Lecture Note 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Little Hi is writing an algorithm lecture note for Little Ho. To make the note more comprehensible, Little Hi tries to color some of the text. Unfortunately Little Hi is using a pla…