描述:有一个会员表,有个birthday字段,值为'YYYY-MM-DD'格式,现在要查询一个时间段内过生日的会员,比如'06-03'到'07-08'这个时间段内所有过生日的会员. SQL语句: Select * From user Where DATE_FORMAT(birthday,'%m-%d') >= '06-03' and DATE_FORMAT(birthday,'%m-%d') <= '07-08'; 根据format字符串格式化date值.下列修饰符可以被用在format字符串
1.时间格式化:SELECT DATE_FORMAT(a.START_TIME, '%Y-%m-%d' ) datime,DATE_FORMAT(a.START_TIME, '%Y-%m' ) motime FROM AGENT_STATUS a; 2.聚合函数:SELECT datime,motime,SUM(CASE WHEN STATUS = '102' THEN 1 ELSE 0 END) jtcount,SUM(CASE WHEN STATUS = '102' THEN DURATIO
(function($){ $.formatDate = function(pattern,date){ //如果不设置,默认为当前时间 if(!date) date = new Date(); if(typeof(date) ==="string"){ if(date=="") date = new Date(); else date = new Date(date.replace(/-/g,"/")); } /*补00*/ var toFix