Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clausesyntax error: SELECT count(id) AS numrows FROM table_news where id IN (select id_pro from table_protag where id_tag='304') order by stt asc,ngaytao desc