常用sql集合

1.按照年份月份拆分字段,並統計。 SELECT DATE_FORMAT(creat_time,"%Y年%m月") AS dates,COUNT(*) FROM ssoml.mlcp_node GROUP BY DATE_FORMAT(creat_time,"%Y年%m月") ORDER BY DATE_FORMAT(creat_time,"%Y年%m月") DESC ; 如圖:  
相關文章
相關標籤/搜索