MySQL中 Bigint类型无法通过year函数直接转换
MySQL中 Bigint类型无法通过year函数直接转换,需要通过FROM_UNIXTIME(create_date/1000)转换成Date
year(FROM_UNIXTIME(create_date/1000))
测试:
select year(FROM_UNIXTIME(create_date/1000)) as year ,
month(FROM_UNIXTIME(create_date/1000)) as month,
count(*) as count
from ms_article group by year,month;

浙公网安备 33010602011771号