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_product where type='san-pham' and id_danhmuc='31' and hienthi=1 order by stt,id desc