select * from score_get where substring(Convert(char(10),get_time,112),1,8)='20100325' select * from score_get where get_time between '2010-03-25 00:00:00' and '2010-03-25 23:59:59' select * from score_get where year(get_time) = 2010 and month(get_ti
MySQL的YEARWEEK函数以及查询本周数据 MySQL 的 YEARWEEK 是获取年份和周数的一个函数,函数形式为 YEARWEEK(date[,mode]) 例如 2010-3-14 ,礼拜天 SELECT YEARWEEK('2010-3-14') 返回 11 SELECT YEARWEEK('2010-3-14',1) 返回 10 其中第二个参数是 mode ,具体指的意思如下: Mode First day of week Range Week 1 is the first we
mysql查询当天的所有信息: select * from test where year(regdate)=year(now()) and month(regdate)=month(now()) and day(regdate)=day(now())这个有一些繁琐,还有简单的写法: select * from table where date(regdate) = curdate();另一种写法没测试过查询当天的记录 select * from hb_article_view where TO