1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| SELECT NUMERO_SIRET_CABINET, COUNT(*) AS NOMBRE_DOSSIERS
FROM DOSSIERS.FIC
WHERE ((DATE_RAPPORT_1A>='20090608' AND DATE_RAPPORT_1A<='20090614') OR (DATE_RAPPORT_1A='' AND DATE_RAPPORT_1B>='20090608' AND DATE_RAPPORT_1B<='20090614'))
GROUP BY NUMERO_SIRET_CABINET
UNION ALL
SELECT f1.NUMERO_SIRET_CABINET,COUNT(DISTINCT f1.ID_DOSSIER) AS NBVGE
FROM DOSSIERS.FIC AS f1
LEFT OUTER JOIN DANGEROSITE_DOSSIER.FIC AS f2 ON f1.ID_DOSSIER = f2.ID_DOSSIER
WHERE (CODE_DANGEROSITE IN('CA3', 'LS3', 'DI3', 'SP4') AND DEFICIENCE_IMPUTABLE='1')
AND CODE_GENRE IN('TAGE03', 'TAGE16', 'TAGE30')
AND CODE_NATURE_EVENEMENT IN('TANE11', 'TANE12')
AND ((DATE_RAPPORT_1A>='20090608' AND DATE_RAPPORT_1A<='20090614' AND DANGEROSITE_1A='1') OR (DATE_RAPPORT_1A='' AND DATE_RAPPORT_1B>='20090608' AND DATE_RAPPORT_1B<='20090614' AND DANGEROSITE_1B='1'))
AND REPARABILITE_ECONOMIQUE = '1'
GROUP BY f1.NUMERO_SIRET_CABINET |
Partager