Right Outer Join Oracle SQL
I was working on a query recently in Oracle and couldn't find this answer anywhere on the internet, so I figured I'd put it here for future reference.
Joins - Right, Left, Full OUTER
Joins in Oracle default to inner if you don't do them right, yep, they don't error, they just default to inner. So if you are trying to get an outer join to work and you are getting less results than you know you should, look for a missing (+).
Here's a demonstration:
select a.Hello,b.World from first_table a, second_table b where a.greeting = b.greeting(+) and b.holiday(+) = 'C'
You can't pull from a table and use the join unless you join all the criteria as well. It's really basic in this query, but gets more complicated if you are hitting multiple tables.
Post made: Tue, Dec 9 2008 - 12:04 PM
Category: General Webby Stuff
Tags: ORACLE |SQL |Joins ORACLE |Queries |
