1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
SELECT DISTINCT s.telex, s.raison_sociale, i.num_incident, to_char(i.date_creation,'dd/mm/yyyy')as date_creation, to_char(i.date_creation,'HH24:MM:SS') as heure_creation,
id.libelle_demande, i.etat, ir.categorie, ir.sous_categorie
FROM societe s, incident i, incident_demande id, incident_reponse ir, contrat_service_detail csd
WHERE s.id_societe = i.id_societe
AND s.id_societe=csd.id_societe
AND id.num_incident = i.num_incident
AND ir.num_incident = i.num_incident
AND ir.type_reponse = 20
AND id.type = 10
AND i.num_incident >= '$num_dep'
AND i.date_creation <= to_date('$date_fin','dd/mm/yyyy hh24:mi:ss')
AND csd.contrat_savoye = 1
UNION
SELECT DISTINCT s.telex, s.raison_sociale, i.num_incident, to_char(i.date_creation,'dd/mm/yyyy')as date_creation, to_char(i.date_creation,'HH24:MM:SS') as heure_creation,
id.libelle_demande, i.etat, ir.categorie, ir.sous_categorie
FROM societe s, incident i, incident_demande id, incident_reponse ir, contrat_service_detail csd
WHERE s.id_societe = i.id_societe
AND s.id_societe=csd.id_societe
AND id.num_incident = i.num_incident
AND ir.num_incident = i.num_incident
AND ir.type_reponse = 20
AND id.type = 10
AND i.num_incident <= '$num_dep'
AND i.etat != 60
AND csd.contrat_savoye = 1
ORDER BY to_date (date_creation, 'dd/mm/yyyy'), heure_creation |
Partager