SQL ERROR

1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND pg_subno = 0 AND page_stat = 'Y' ORDER BY pg_idx ASC LIMIT 0,1' at line 1
Query: SELECT MAX(pgcode) AS precode FROM pageConfig WHERE pgcode < 91 AND pg_topno = AND pg_subno = 0 AND page_stat = 'Y' ORDER BY pg_idx ASC LIMIT 0,1;