이 에러는 mysqli에서 나는 에러로
mysqli일 경우 group by를 쓰게 되면
sum이나, min, max, avg를 쓰지 않은 모든 칼럼명을
다 group by에 집어넣어줘야한다.
예시
SELECT idx, {$key_product_number}, site_name, SUM(exposure_cnt) AS exposure_cnt, SUM(click_cnt) AS click_cnt, SUM(total_pay) AS total_pay, SUM(change_cnt) AS change_cnt, SUM(change_pay) AS change_pay, AVG(rank_ave) AS rank_ave FROM {$table_name} WHERE master_id='{$master_id}' {$w_sql} GROUP BY {$key_product_number}
일 경우 에러가 날것이다
하지만
SELECT idx, {$key_product_number}, site_name, SUM(exposure_cnt) AS exposure_cnt, SUM(click_cnt) AS click_cnt, SUM(total_pay) AS total_pay, SUM(change_cnt) AS change_cnt, SUM(change_pay) AS change_pay, AVG(rank_ave) AS rank_ave FROM {$table_name} WHERE master_id='{$master_id}' {$w_sql} GROUP BY {$key_product_number}, idx
이렇게 맨뒤에 idx 값을 준다면 에러가 나지 않는다