Bonjour,
Mon problème est dans l'intitulé, à cela près que j'y ajoute un UNION:
La requête fonctionne très bien sans l'ajout des colonnes supplémentaires MA et 120 mais lorsque j'ajoute ces dernières, je me retrouve avec l'erreur suivante: ORA-00904: "FORMAT" : identificateur non valide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 select distinct 'MA' as format, substr (ACDAT, 1, 4) as annee, ACLIB as campagne, count (*) from SUIVI where ACCAT in ('W28', 'W29', 'W30', 'W31', 'W32', 'W33', 'W34') and ACDAT >= '20151001' group by format, substr (ACDAT, 1, 4), ACLIB union select distinct '120' as format, to_char (DATE_QUANT,'yyyy') as annee, LIB_ACTION as campagne, count (*) from 120_PRO where DATE_QUANT >= '01/10/2015' group by format, to_char (DATE_QUANT,'yyyy'), LIB_ACTION order by 1, 2 ;
Quelqu'un aurait-il une idée pour régler ce problème ?
Merci.
Partager