Q:

How to take aggregate of a data Grouped by Financial Year in SQL

My Financial Year is between  1st July to 30th June e.g 2018-07-01 and 2019-06-30 
I have following data. 

i want to aggregate of Rate column by financial year in sql
please help. 

A:

If I correctly understood what you're looking for, this should work for you. 
SELECT 
    SUM(Rate) as Rate,
    CASE WHEN MONTH(FromDate) < 7 THEN YEAR(FromDate) - 1 ELSE YEAR(FromDate) END AS Fiscal_Year
FROM #t
GROUP BY CASE WHEN MONTH(FromDate) < 7 THEN YEAR(FromDate) - 1 ELSE YEAR(FromDate) END 

