-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Quering different tables by using Left Join (HBM)
PostPosted: Thu Mar 16, 2006 9:01 am 
Newbie

Joined: Sat Feb 04, 2006 6:31 pm
Posts: 3
Location: india
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.