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='dich-vu' and id_danhmuc='11' and id<>'158' and hienthi=1 order by stt,id desc