您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

mysql怎么根据date做年,月,日分组统计查询

2024/3/24 23:54:36发布19次查看
使用 year(), month(), day() 来获取年月日
select year(application_date) as years, count(1) from patent group by year(application_date) order by years-- year(application_date) 获取年份-- month(application_date) 获取月份-- day(application_date) 获取日
使用 date_format(application_date, '%y'),可自定义日期格式
select date_format(application_date, "%y") as year, count(1) from patent group by date_format(application_date, "%y")
推荐:《mysql教程》
以上就是mysql怎么根据date做年,月,日分组统计查询的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product