ERRO | SQL> SELECT b.brs_nome, b.brs_id, COUNT(*) as count FROM imoveis i LEFT JOIN brasil_bairros b ON b.brs_id = i.brs_id WHERE i.sit_id = 14 AND i.imo_tipo = AND i.imo_alugado=1 AND b.brs_nome != '' AND b.bre_id= GROUP BY i.brs_id ORDER BY count DESC LIMIT 0,8
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND i.imo_alugado=1 AND b.brs_nome != '' AND b.bre_id= GROUP BY i.brs_id ORDER ' at line 3