Hi,
i want to use query from three different table and i am using left join.
i am getting correct output by running the following query.
SELECT GOOD_CLAIM_ID,F_GOOD_CLAIM_ID,M_GOOD_CLAIM_ID FROM WPPAUP.GOOD_CLAIM
LEFT OUTER JOIN WPPAUP.M_GOOD_CLAIM
ON GOOD_CLAIM_ID = M_GOOD_CLAIM_ID
LEFT OUTER JOIN WPPAUP.F_GOOD_CLAIM
ON GOOD_CLAIM_ID = F_GOOD_CLAIM_ID
where GOOD_CLAIM_ID=9002
GOOD_CLAIM -> Table
GOOD_CLAIM_ID -->col
9000
9001
9002
9003
M_GOOD_CLAIM -> Table
M_GOOD_CLAIM_ID -->col
9000
9001
F_GOOD_CLAIM -> Table
F_GOOD_CLAIM_ID -->col
9002
9003
so it should give one record.
for example where GOOD_CLAIM_ID= 9001
then it should show as
GOOD_CLAIM_ID=9001
F_GOOD_CLAIM_ID=<empty>
M_GOOD_CLAIM_ID=9001
how could i make HBM query from the above query.
or
could i write the same query without the join query by change the sql query
Thanks for your time,
With Regards,
Subramanain T
|