Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

left join

 
sangeetha krishnamurthi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the scenario for us

Table 1 has 2 primary keys columns as t1 and t2.

Table 2 has 1 primary key column as t3

we need to do left outer join where the join condition is Table 1 column t4 is compared to table 2 t3 column.

This query and tables are existing and we cannot change anything in the db side.

We are using websphere 6.1 and openJPA as JPA provider.

Please do help me to implement the left join
[ January 08, 2008: Message edited by: Bear Bibeault ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just do the "join" in the "where" clause

where table1.t4 = table2.t3(+)

or

where (table1.t4 = table2.t3 or table1.t4 is null)

Something like that.

What database are you using?

Mark
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!