By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,798 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

Convert Oracle outer join query to PostgreSql

P: 2
Hello all.. I am trying to convert an application which is working on Oracle to postgreSql..
I've seen a query in code something like this...

Expand|Select|Wrap|Line Numbers
  1. select  *
  2. from    table1 a1 , table1 a2, table2 a3,        
  3. where   a1.childid = a2.parentid(+)
  4. and     a2.childtype (+)= 'Something'
  5. and     a2.parenttype (+)= 'Something'
  6. and     a2.childid = a3.id (+)
It's been used oracle iso99 style (+) outer join as you see..

But..I've searched google, other forums.. But i can't convert this query to postgreSql..(my mind is stopped)
Postgre wants me to use LEFT JOIN RIGHT JOIN, and wants me to use this after the FROM word..
So.. I am confused. Have you got any idea for this query?

Thanks in advance..
Oct 28 '08 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
Try
Expand|Select|Wrap|Line Numbers
  1. select  *
  2.  from table1 a2  
  3.       left join table1 a1 on (a1.childid = a2.parentid)
  4.        right join table2 a3 on (a2.childid = a3.id) 
  5.        where ( a2.childtype = 'Something' or a2.childtype is null)
  6.        and ( a2.parenttype = 'Something' or a2.parenttype is null)
Oct 31 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.