查找所有分类及其子类的数目,显示错误
为什么当我查找所有分类及其子类,用 SELECT p.type_id,p.type_name,s.type_name FROM tdb_goods_types AS p LEFT JOIN tdb_goods_types AS s ON s.parent_id = p.type_id;
正确,但是在后面加上GROUP BY p.type_name;不对啊。显示
Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 't1.s.type_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by