 | ERROR SQL >> SELECT IF(p.star_avg IS NULL, 0 , p.star_avg) AS 'star_avg', count(1) AS 'totalReview' FROM (
SELECT (SUM(shop_star)/COUNT(1)) AS 'star_avg' FROM review_shop
WHERE shop_id = 'SOP30'
) p
In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'p.star_avg'; this is incompatible with sql_mode=only_full_group_by |
|