Imbriquer 3 requêtes en une seule
Bonjour ma question peut paraître bête mais voilà : j'ai 3 requêtes que j'aimerais compilées en une seule.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| select PO_FRAPPE,SUM(po_p1_froid) PDSOBS
from Q_PORCS
where PO_OBS1 > 0 or PO_OBS2 > 0 or PO_OBS3 > 0
group by PO_FRAPPE;
select PO_FRAPPE,count(PO_MFS) MFS
from Q_PORCS
where PO_MFS = 'S'
group by PO_FRAPPE;
select PO_FRAPPE,COUNT(po_tmp) TMP53
from Q_PORCS
where PO_TMP < 530
group by PO_FRAPPE;
select PO_FRAPPE,COUNT(po_tmp) TMP64
from Q_PORCS
where PO_TMP > 640
group by PO_FRAPPE; |
est-ce possible ?
Merci de votre aide.
il faut ajouter entre les requetes la clause union pour reunir les resultats
Citation:
Envoyé par
jfcollombet
Bonjour ma question peut paraître bête mais voilà : j'ai 3 requêtes que j'aimerais compilées en une seule.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| select PO_FRAPPE,SUM(po_p1_froid) PDSOBS
from Q_PORCS
where PO_OBS1 > 0 or PO_OBS2 > 0 or PO_OBS3 > 0
group by PO_FRAPPE;
select PO_FRAPPE,count(PO_MFS) MFS
from Q_PORCS
where PO_MFS = 'S'
group by PO_FRAPPE;
select PO_FRAPPE,COUNT(po_tmp) TMP53
from Q_PORCS
where PO_TMP < 530
group by PO_FRAPPE;
select PO_FRAPPE,COUNT(po_tmp) TMP64
from Q_PORCS
where PO_TMP > 640
group by PO_FRAPPE; |
est-ce possible ?
Merci de votre aide.