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 type='tin-tuc' and id_danhmuc='71' and hienthi=1 order by stt,id desc