Bonjour,
voici une requête avec un regroupement sur 4 champs :
et voici a quoi ressemble le résultat :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 select distinct po_frappe,case when PO_OBS1 > 0 then PO_OBS1 end as OBS1, case when PO_OBS1 >0 then SUM(po_p1_froid/10) end as P_OBS1, case when PO_OBS2 > 0 then PO_OBS1 end as OBS2, case when po_obs2 >0 then SUM(po_p1_froid/10) end as P_OBS2, case when PO_OBS3 > 0 then PO_OBS3 end as OBS3, case when PO_OBS3 >0 then SUM(po_p1_froid/10) end as P_OBS3 from Q_PORCS group by PO_FRAPPE,PO_OBS1,PO_OBS2,PO_OBS3 order by PO_FRAPPE;
J'aimerais en fait pouvoir regrouper uniquement par le champ po_frappe pour avoir une somme global du champ po_p1_froid.
Comment puis-je procéder ?
Partager