I would like to make a statistics of how many members are of a given age in the population, and the total number of their cars.
So far I've got this:
select round((SYSDATE - sz.born)/365,0), count(carid)
from person sz inner join cars k
on sz.personid = k.ownerid
group by 1
Says it's not a group by expression and I don't know why.