SELECT *, obr.erp_obr_codigo as erp_obr_codigo FROM erp_obra obr LEFT JOIN erp_obra_imagem img ON (img.erp_obr_codigo = obr.erp_obr_codigo AND img.obr_ima_visualizacao_thumbnail = 1) WHERE obr.erp_obr_publicar_site=1 AND (erp_obr_validade IS NULL OR erp_obr_validade >= NOW() ) AND erp_obr_data_publicacao <= NOW() AND obr.erp_obr_ass_codigo = 341 GROUP BY obr.erp_obr_codigo order by erp_obr_codigo asc limit 0, 50
Column 'erp_obr_codigo' in order clause is ambiguous--83