摘要:
按周 select DATE_FORMAT(create_time,'%Y%u') weeks,count(caseid) count from tc_case group by weeks; 按月 select DATE_FORMAT(create_time,'%Y%m') months,coun 阅读全文
摘要:
SELECT * FROM table_name WHERE to_days(createtime) = to_days(now()); SELECT * FROM table_name WHERE YEARWEEK(date_format(createtime,'%Y-%m-%d')- INTER 阅读全文
摘要:
mysql查询今天、昨天、上周 今天 select * from 表名 where to_days(时间字段名) = to_days(now()); 昨天 SELECT * FROM 表名 WHERE TO_DAYS( NOW( ) ) - TO_DAYS( 时间字段名) <= 1 7天 SELEC 阅读全文
摘要:
select id, phone,time,year(time),month(time), DAY(time),TIME(time) from user where phone='xxxxxx' #分别取年、月、日、时间select id, phone,time from user where ph 阅读全文