【发布时间】:2021-01-03 20:01:21
【问题描述】:
我使用下面的查询来获取计数、月份名称和金额,但下面的查询显示数据库中可用的所有记录。我只需要显示财政年度。就像我必须显示从01-04-2020 到31-03-2021 的数据。
我想知道我必须更改什么查询?
SELECT COUNT(f_id) as count
, MONTHNAME(date_of_created) as month_name
, sum(f_amt) as amount
FROM tbl_fileStatus
WHERE f_filestatus=1
GROUP
BY YEAR(date_of_created)
, MONTH(date_of_created)
【问题讨论】: