select * from ( SELECT wve_idsite as idsite, wve_codigo as codigo, wve_quartos as quarto,wve_tipoimovel as tipoimovel, 'Venda' AS tipo, wve_valor as valor, wve_bairro as bairro, wve_cidade as cidade, wve_quartos as quartos, wve_areaconstruida as areaconstruida, wve_garagem as garagem, wv.wve_edificio as edificio, wv.wve_rua as rua FROM webvenda wv WHERE 1 AND wv.wve_fotos = 's' GROUP BY wve_codigo UNION all SELECT wlo_idsite as idsite, wlo_codigo as codigo, wlo_quartos as quarto,wlo_tipoimovel as tipoimovel, 'Locação' AS tipo, wlo_valor as valor, wlo_bairro as bairro, wlo_cidade as cidade, wlo_quartos as quartos, wlo_areaconstruida as areaconstruida, wlo_garagem as garagem, wv.wlo_edificio as edificio, wv.wlo_rua as rua FROM weblocacao wv WHERE 1 AND wv.wlo_fotos = 's' GROUP BY wlo_codigo ) as tabela where 1 and idsite in () order by codigo desc
Nº do Erro: 1064 - Descrição: 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 ') order by codigo desc' at line 1