Solved

oracle joins

Posted on 2011-03-24
1
226 Views
Last Modified: 2012-05-11
experts... This looks like a simple question. I have 2 tables with oid as the common key.
If I want to get the records from table a which have a match with table b plus the records from table a which does not have a match with table b, how do I query that?

for ex: table a has the records
oid       name    
1          aaa                    
2          bbb
3          ccc
4          ddd
5          eee

and table b has the columns

oid      name   value
1          aaa     101
2          bbb      102

I want the output like

oid           name          value
1              aaa            101
2              bbb             102
3              ccc          
4              ddd
5             eee
0
Comment
Question by:chickanna
1 Comment
 
LVL 35

Accepted Solution

by:
johnsone earned 500 total points
ID: 35210403
Is this what you are looking for?
select a.oid, a.name, b.value
from tablea a left outer join tableb b
on a.oid = b.oid;

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question