Error Number: 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 `categoria_id` = '45' AND `subcategoria_id` IS NULL AND `status` = '1' ORDER' at line 6

SELECT * FROM (`st_agendas`) WHERE `id` <> '104' AND `id` < '104' AND `data` <= AND `categoria_id` = '45' AND `subcategoria_id` IS NULL AND `status` = '1' ORDER BY `id` desc, `data` desc