Database error: Invalid SQL: SELECT distinct ap_of.id, ap_of.date_resultat, ap_of.lieu_retrait_ar, ap_mf.description_ar AS decription_modefinanc, ap_of.objet_ar AS objet, ap_type.description_ar AS description_type, ap_of.ref_etat, ap_et.description_ar AS description_etat FROM ap_etat ap_et RIGHT JOIN ap_appeldoffre ap_of LEFT JOIN ap_mode_financement ap_mf ON ap_of.ref_mode_financement = ap_mf.id ON ap_et.id = ap_of.ref_etat LEFT JOIN ap_lot ON ap_of.id = ap_lot.ref_appel_offre LEFT JOIN sect_secteur ON ap_lot.ref_secteur = sect_secteur.id LEFT JOIN ach_public ON ap_of.ref_ach_public = ach_public.id LEFT JOIN ap_type ON ap_of.ref_type = ap_type.id WHERE ap_of.ref_etat =9 and ap_of.semestre=1 and date_part('year', ap_of.date_resultat) =2019 order by ap_of.ref_type ASC
PostgreSQL Error: 1 (ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list)
Session halted.