Subject RE: [firebird-support] Select - problem with Group by
Author Alan McDonald
> Hello -
> I have this query :
>
> SELECT
> B.CODE_PROD ,
> SUM(B.QTE_RECUE_ENT)
>
> FROM
> RECEPTION_MARCHANDISE_MAITRE A,
> RECEPTION_MARCHANDISE B
>
> where
> A.NO_RECEPTION=B.NO_RECEPTION_MAITRE
> AND DATE_RECUE='2004-12-17'
> AND A.VALIDER='O'
> AND A.NO_SUCC=3
> GROUP BY B.CODE_PROD
>
> -----------
> From this, i want only B.CODE_PROD showing ACTIF='Y' from table
> PRODUIT C to show. (Note: CODE_PROD are identical in both PRODUIT and
> RECEPTION_MARCHANDISE tables). I have found no way to add this filter
> to the existing script. Any one have an idea? Thank. RP.

> SELECT
> B.CODE_PROD ,
> SUM(B.QTE_RECUE_ENT)
>
> FROM
> RECEPTION_MARCHANDISE_MAITRE A JOIN
> RECEPTION_MARCHANDISE B
ON
> A.NO_RECEPTION=B.NO_RECEPTION_MAITRE
JOIN PRODUIT C ON
A.NO_RECEPTION=C. whatever
> where
>
> B.DATE_RECUE='2004-12-17'
> AND A.VALIDER='O'
> AND A.NO_SUCC=3
and c.actif='Y'
> GROUP BY B.CODE_PROD