// #1242 - Subquery returns more than 1 row
SELECT (sum(view)-max(view)-min(view))/(count(media_id)-2),count(media_id)
FROM ms_media_share as a
WHERE ( select count(media_id) from ms_media_share group by media_id )
NOT IN (1,2,3)
GROUP BY media_id
// #1111 - Invalid use of group function
SELECT (sum(view)-max(view)-min(view))/(count(media_id)-2),count(media_id)
FROM ms_media_share as a
WHERE count(media_id) > 3
GROUP BY media_id
// 可行
SELECT (sum(view)-max(view)-min(view))/(count(media_id)-2),count(media_id)
FROM ms_media_share as a
GROUP BY media_id
求助,谁知道原因的麻烦告诉一下,谢谢
你不可能同时又group by一列,同时又要去count这同一列,你要想count的话,count别的列才行。