SELECT
CASE WHEN MONTH(service_date)>=7 THEN
concat(YEAR(service_date), '-',YEAR(service_date)+1)
ELSE concat(YEAR(service_date)-1,'-', YEAR(service_date)) END AS financial_year,
SUM(invoice_amount)
FROM mytable
GROUP BY financial_year
které produkují o/p jako níže
financial_year invoice_amount
2007-2008 10000.00
2008-2009 15000.00
2009-2010 20000.00