Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10548

SQL Expression case

$
0
0

I have to fetch some data this way because all links are failing. How do I specify that i want to also select the second table, the ICDET76PK. THIs one is not working on the first =. The thing is I want this to be distinct on the ICDET76PK.ITTRN#

because, the testpk1 is a summary table and the other is detail, if there are more than 1 detail records for part# and invoice then we don't want to fetch twice. we basically want to fetch the invoice amt for the part, this is summarized and correct.

 

 

(

SELECT 

    PKLIB.TESTPK1.LINTOT01,

FROM

    PKLIB.TESTPK1

 

 

WHERE

        PKLIB.TESTPK1.IDINV# = PKLIB.ICDET76PK.ITTRN#

AND     PKLIB.TESTPK1.IDPRT# =

PKLIB.ICDET76PK.ITPRT#

 

)


Viewing all articles
Browse latest Browse all 10548

Trending Articles