SQL Error: 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 ')' at line 4
SELECT COUNT(CODIGO) as n FROM fbz_imoveis imo WHERE VER_WEB='Sim' AND (STATUS = 'VENDA' OR STATUS = 'ALUGUEL' OR STATUS = 'VENDA E ALUGUEL') AND INSTR(STATUS,'ALUGUEL')>0 AND (SITUACAO<>'Lançamento' OR LANCAMENTO<>'Sim') and ( CODIGO_CATEGORIA='terreno' ) and ( )