Subject | Re: JOIN NOT WORKING CORRECTLY |
---|---|
Author | Dixon Epperson |
Post date | 2003-09-23T20:13:42Z |
Thanks Alexandre
I just couldn't see it, but I should have. it work right now.
Dixon Epperson
I just couldn't see it, but I should have. it work right now.
Dixon Epperson
> I will reformat your query, since I think will be easier to readit...
>PO_LOCID
> The problem is that in your WHERE clause will filter records using
> = WH_LOCID (if you do not have a PO for the product the PO_LOCIDwill be
> null and NULL is not equal to anything), so the where clause isresticting
> the result set to return only the products that has PO. use thefilter
> condition on the join clause, since you specify left join even theproducts
> that does not have PO will be retrivied.= 100
>
> try something like
>
> SELECT
> WH_STCK, WH_BC, SUM(WH_QTY), PR_NAME ||' '||PR_DESC,
> PR_PARLVL, PD_QTY, PO_ETA
> FROM
> WAREHOUSE JOIN
> PRODUCT ON (WH_STCK=PR_STOCKNO) LEFT JOIN
> PODETAIL ON (PD_STCK LIKE WH_STCK ||'%') LEFT JOIN
> POTABLE ON (PD_NUM=PO_NUM and PO_LOCID = '000011' and PO_LOCSEQ
> and PO_INV = '')
> WHERE
> WH_LOCID='000011' AND
> WH_LOCSEQ=100
> GROUP BY
> WH_STCK, WH_BC, PR_NAME, PR_DESC, PR_PARLVL, PD_QTY, PO_ETA
> HAVING
> SUM(WH_QTY) < PR_PARLVL *1.10
>
> HTH
>
>
> Alexandre Benson Smith
> Development
> THOR Software e Comercial Ltda.
> Santo Andre - Sao Paulo - Brazil
> www.thorsoftware.com.br