20 pts.
 Alternative for LEFT OUTER JOIN
HI all, select code.batchno, detailA.batchfee , detailB.batchfee from Code code left outer join Detail detailA on (detailA.id= code.id) left outer join Detail detailB (detailB.id= code.id) where code.category = categoryA order by code.id I want an alternative for left outer join.. I cannot use left outer join for some purpose.. So i need an alternative for it but doing the same.. Thanks in advance

Software/Hardware used:
ASKED: March 5, 2009  5:23 AM
UPDATED: July 28, 2010  1:17 PM
  Help
 Approved Answer - Chosen by carlosdl

Hi..
Am using Hibernate on Postgres

So I am using HQL query and in HQL to use a left outer join the two entities must be assosiated..
And I cannot assosiate those two entities at this point cos it may tweak the existing data.
So i wanted an immidiate alternative for left outer join..

And i got it..

select code.batchno, (select detailA.batchfee from Detail detailA
where detailA.id= code.id),( select detailB.batchfee from Detail detailB where detailB.id= code.id) from Code code where code.category = categoryA order by code.id

Thank you..

ANSWERED:  Mar 6, 2009  5:18 AM (GMT)  by carlosdl

 
Other Answers:

<pre> <li><ol>
<ul></ul></ol></li></pre>

Last Wiki Answer Submitted:  July 28, 2010  5:06 am  by  Srinivasgedda   15 pts.
Latest Answer Wiki Contributors:  Srinivasgedda   15 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Can you share with us, why you cannot use an outer join ?
What database are you using ?
Do you want to do this with SQL only ( or you can use a t-sql or pl/sql procedure/function) ?

 63,535 pts.

 

Thanks for sharing.

 63,535 pts.