Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Simple SQL Query
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