I know I am repeating what Lamprey said, but don't group by orderdate, instead group by year(orderdate). That would give you one row per product, per year. The only way that you will still be getting multiple rows is if the prodname is different in each row (perhaps because of hidden characters)Select count(Prodname) ProdCount, ProdName, year(orderdate) year
from products
inner join orders on prodnum = orderprodnum
group by prodname, year(orderdate)
Order By Prodname, year(orderdate)