Solved

oracle joins

Posted on 2011-03-24
1
227 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

740 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