<! SELECT DATE_FORMAT(created_date,'%Y-%m-%d') as time,sum(money) money FROM o_finance_detail where org_id = 1000 GROUP BY time <! SELECT DATE_FORMAT(created_date,'%Y-%m') as time,sum(money) money FROM o_finance_detail where org_id = 1000 GROUP BY time <! SELECT DATE_FORMAT(created_date,'%Y') as time,sum(money) money FROM o_finance_detail where org_id = 1000 GROUP BY time <! SELECT DATE_FORMAT(created_date,'%Y-%u') as time,sum(money) money FROM o_finance_detail where org_id = 1000 GROUP BY timeCopy the code
DATE_FORMAT(date,format) Formats the date value according to the format string. The following modifiers can be used in the format string: %M Month name (January...... December) %W Sunday... Saturday) %D Dates of months with English prefixes (1st, 2nd, 3rd, etc.) %Y year, number, 4 digits %Y year, number, 2 digits %a abbreviated name of the week (Sun... Sat) %d number of days in month (00...... 31) %e Number of days in a month (0...... 31) %m month, number (01...... 12) % C months, figuresCopy the code