日期时间函数1.取得当前日期时间SELECT NOW(), SYSDATE(),CURRENT_TIMESTAMP() FROM DUAL2.取得当前日期SELECT CURDATE(),CURRENT_DATE() FROM DUAL3.取得当前时间SELECT CURTIME(),CURRENT_TIME() FROM DUAL4.计算两个日期之间的差值 DATEDIFF(date1,date2),返回的是date1-date2之间的差的天数 SELECT DATEDIFF('2015010…
首先创建一张实验用的一张表 drop table if exists t_student; create table t_student( id int primary key auto_increment, name ) not null comment '姓名', birthday date comment '生日' )Engine=InnoDB default charset utf8; insert into t_student values(null,'tom','1992-02-03…
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER FUNCTION [dbo].[ufn_getDateOfWeek] (@Date Datetime) ) AS BEGIN ); then '一' then '二' then '三' then '四' then '五' then '六' then '日' end; RETURN @returnValue END --------------------- set ANSI_NULLS ON…