jointure externe sous oracle
SELECT da.DEF_MISSION,
da.DEF_DATE,
da.NIV_PRIO,
da.ETAT,
rst.stat_rst,
rst.stat_prop
FROM TFAFRNDA da
LEFT OUTER JOIN TFAFRNRST rst ON (da.def_mission = rst.no_cnv AND
da.def_date = rst.dh_dep)
WHERE (DEF_MISSION IN ('TOTO))
AND DEF_DATE BETWEEN
TO_DATE('2009/05/15 00:00:00', 'yyyy/mm/dd hh24:mi:ss') AND
TO_DATE('2009/05/15 00:00:00', 'yyyy/mm/dd hh24:mi:ss')
UNION
SELECT rst.no_cnv, rst.dh_dep, null, null, rst.stat_rst, rst.stat_prop
FROM TFAFRNRST rst
WHERE (no_cnv IN ('TOTO))
AND dh_dep BETWEEN
TO_DATE('2009/05/15 00:00:00', 'yyyy/mm/dd hh24:mi:ss') AND
TO_DATE('2009/05/15 00:00:00', 'yyyy/mm/dd hh24:mi:ss')
ORDER BY DEF_MISSION, DEF_DATE ASC
select * from proprietaire p full outer join voiture v on (p.id_utilisateur = v.id_utilisateur)
Aucun commentaire:
Enregistrer un commentaire