SQL Group by Year
With MariaDB:
SELECT year(date) FROM cost GROUP BY year(date)
How about:
select datepart(yyyy, [date]) as [year]
from shoptransfer
group by datepart(yyyy, [date])
Or:
select count(*) as qty, datepart(yyyy, [date]) as [year]
from shoptransfer
group by datepart(yyyy, [date])
order by [year]
This is based on OP's command: "I want to group by year part of date (varchar) column"