
postgresql--column must appear in the group by clause or be used in an aggregate function
我想得到男女当中大于各自性别平均年龄的人原表:在gauss200下执行以下语句:SELECTstname,age,gender,AVG(age)FROMatt_test01GROUPBYgenderHAVINGage>AVG(age); 报错:columnatt_test01.stnamemustappearinthegroupbyclauseorbeusedinanaggregatefun