Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Simple SQL Query

Simple SQL Query

From: Muggle <zimpany_at_gmail.com>
Date: 2 Jan 2007 13:46:58 -0800
Message-ID: <1167774418.684661.96560@k21g2000cwa.googlegroups.com>


Hello everyone,

I have a simple requirement here. Need some help.

I have two tables: TableA and TableB. I want to retrieve all the columns from TableA and column EVENT, if there is a record present, from TableB. The column that joins the two tables is YEAR.

I am trying to execute a query like this :

Select TableA.*, TableB.EVENT from TableA, TableB where TableA.YEAR='1900' and TableA.YEAR= TableB.YEAR

Obviously this returns nothing when TableB has no entry for Year 1900. When there is no record present I want the query to return a null for the EVENT column and all the columns from TableA.

I have no control over the database design.

Thanks in advance
Muggle Received on Tue Jan 02 2007 - 15:46:58 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US