ERRO | SQL> SELECT c.*, bb.brs_nome, bc.bre_nome, be.bro_nome, be.bro_sigla, (SELECT vevi_link_youtube FROM vendas_empreendimentos_videos as a WHERE a.vem_id=c.vem_id ORDER BY vevi_id ASC LIMIT 1) as vevi_link_youtube, (SELECT CONCAT(f.vega_id, '/g_', f.vegf_arquivo) FROM vendas_empreendimentos_galerias_fotos as f LEFT JOIN vendas_empreendimentos_galerias as g ON f.vega_id=g.vega_id WHERE (g.vega_tipo=1 OR g.vega_tipo=4) AND c.vem_id=g.vem_id GROUP BY vem_id ORDER BY vem_id, vegf_id LIMIT 1) as vegf_arquivo FROM vendas_empreendimentos as c LEFT JOIN brasil_bairros bb ON bb.brs_id = c.brs_id LEFT JOIN brasil_cidades bc ON bc.bre_id = bb.bre_id LEFT JOIN brasil_estados be ON be.bro_id = c.bro_id WHERE c.sit_id = 14 AND c.vem_publicar=1 AND c.vem_quartos=1, 2 e 3 ORDER BY vem_id DESC
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 ' 2 e 3 ORDER BY vem_id DESC' at line 12