Syntax error, unexpected token AND, near to ' giaw BETWEEN 500000 AND 1000000 AND s9 NOT IN(7) AND s8 NOT IN(7) AND s7 NOT IN(7) AND s6 NOT IN(7) AND s5 NOT IN(7) AND s4 NOT IN(7) AND s3 NOT IN(7) AND s2 NOT IN(7) AND s1 NOT IN(7) AND s9 = 6 AND s8 = 3 AND s7 = 6 ORDER BY giaw DESC LIMIT :APL0: OFFSET :APL1:', when parsing: SELECT [KhoSim].* FROM [KhoSim] WHERE status = 0 AND mang = 2 AND AND giaw BETWEEN 500000 AND 1000000 AND s9 NOT IN(7) AND s8 NOT IN(7) AND s7 NOT IN(7) AND s6 NOT IN(7) AND s5 NOT IN(7) AND s4 NOT IN(7) AND s3 NOT IN(7) AND s2 NOT IN(7) AND s1 NOT IN(7) AND s9 = 6 AND s8 = 3 AND s7 = 6 ORDER BY giaw DESC LIMIT :APL0: OFFSET :APL1: (334)