我有以下查询
select wbod.subject, wbi.object,
age(dod.object,wbod.object) as ageOfPerson
from wasbornin as wbi,
wasbornondate as wbod,
diedondate as dod
where wbi.subject=wbod.subject
and wbod.subject=dod.subject
and age(dod.object,wbod.object) = (select max(age(dod1.object,wbod1.object))
from wasbornin as wbi1,
wasbornondate as wbod1,
diedondate as dod1
where wbi1.subject = wbod1.subject
and wbod1.subject=dod1.subject
group by wbi1.object)
group by wbi.object
ORDER BY wbi.subject;
但它给出了以下错误
column "wbod.subject" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: select wbod.subject, wbi.object
为什么会出现这个错误