56,675
社区成员
发帖
与我相关
我的任务
分享
-- 一年前
select *,YEAR(hd_create) from table where year(dateTime)=year(date_sub(now(),interval 1 year));
[/quote]我这个还查不了,它这个时间都是毫秒数。
-- 一年前
select *,YEAR(hd_create) from table where year(dateTime)=year(date_sub(now(),interval 1 year));
SELECT * FROM table
where inputtime>DATE_SUB(CURDATE(), INTERVAL 1 WEEK) --一周
where inputtime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH) --三月
where inputtime>DATE_SUB(CURDATE(), INTERVAL 1 YEAR) --一年
select * from table where year(from_unixtime(这里是毫秒数时间, '%Y-%m-%d %H:%i:%S'))=year(date_sub(now(),interval 1 year));
[/quote]谢谢等待~~~[/quote]
不客气!
select * from table where year(from_unixtime(这里是毫秒数时间, '%Y-%m-%d %H:%i:%S'))=year(date_sub(now(),interval 1 year));
[/quote]谢谢等待~~~
select * from table where year(from_unixtime(这里是毫秒数时间, '%Y-%m-%d %H:%i:%S'))=year(date_sub(now(),interval 1 year));