ADSM-L

SQL: How do you create an outer join with the SELECT command?

1999-12-09 11:52:59
Subject: SQL: How do you create an outer join with the SELECT command?
From: Chris Mawdsley <Chris_Mawdsley AT MANULIFE DOT COM>
Date: Thu, 9 Dec 1999 11:52:59 -0500
Greetings sagacious ones.

For the purpose of this question, I am trying to create a LEFT OUTER JOIN on two
tables.
Specifically,  I want to list all the node names from the NODES table as well as
the schedule names
for the nodes that have schedules from ASSOCIATIONS.

I have tried as many variations as I can think of.

SELECT NODES.NODE_NAME, SCHEDULE_NAME FROM NODES, ASSOCIATIONS WHERE \
NODES.NODE_NAME = ASSOCIATIONS.NODE_NAME
returns only the node names that are in ASSOCIATIONS.

SELECT NODES.NODE_NAME, ASSOCIATIONS.SCHEDULE_NAME \
FROM NODES LEFT JOIN ASSOCIATIONS ON NODES.NODE_NAME = ASSOCIATIONS.NODE_NAME
returns:
ANR2905E Unexpected SQL identifier token - 'JOIN'.
                                      |
         .............................V.................................
         chedule_name from nodes left join associations on nodes.node_na

SELECT NODES.NODE_NAME, SCHEDULE_NAME FROM NODES, ASSOCIATIONS WHERE \
NODES.NODE_NAME = ASSOCIATIONS.NODE_NAME (+)
returns
ANR2908E Unexpected SQL punctuation token - '('.
                                                                     |
         ............................................................V..
          associations where nodes.node_name =associations.node_name (+)

SELECT NODES.NODE_NAME, SCHEDULE_NAME FROM NODES, ASSOCIATIONS WHERE \
NODES.NODE_NAME *= ASSOCIATIONS.NODE_NAME
returns
ANR2907E Unexpected SQL operator token - '='.
                                                 |
         ........................................V......................
         es, associations where nodes.node_name *=associations.node_name

You get the idea.  If anyone knows how to make this work, I would appreciate
knowing how.
TIA,

Chris Mawdsley
Y2K Infrastructure - UNIX
(519) 747-7000 X8192
When the solution is simple, God is answering - Albert Einstein


Chris Mawdsley
Y2K Infrastructure - UNIX
(519) 747-7000 X8192
When the solution is simple, God is answering - Albert Einstein
<Prev in Thread] Current Thread [Next in Thread>
  • SQL: How do you create an outer join with the SELECT command?, Chris Mawdsley <=