Subject | RE: [firebird-support] Select - problem with Group by |
---|---|
Author | Alan McDonald |
Post date | 2004-12-19T00:37:16Z |
> Hello -ON
> 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
> A.NO_RECEPTION=B.NO_RECEPTION_MAITREJOIN PRODUIT C ON
A.NO_RECEPTION=C. whatever
> whereand c.actif='Y'
>
> B.DATE_RECUE='2004-12-17'
> AND A.VALIDER='O'
> AND A.NO_SUCC=3
> GROUP BY B.CODE_PROD