Solved

oracle joins

Posted on 2011-03-24
1
223 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 34

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Query 34 100
Oracle DBLINKS From 11g to 8i 3 35
Oracle - Query link database loop 8 39
Error querying database link from Oracle 10g to Postgresql 7 35
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
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 information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

803 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