Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax on an outer join

Status
Not open for further replies.

heprox

IS-IT--Management
Dec 16, 2002
178
US
I'm new to Sybase syntax and I need to have a simple statement query a recordset for me. I have two tables:

Table1:
plunum price

Table2:
plunum upc

...normally in Oracle I would do somthing like:

SELECT table1.plunum, table2.xrefnum, table1.price FROM tabel1, table2
WHERE table.plunum = table2.plunum(+)
AND table1.plunum='00080521507'

...in order to get an outer join between the tables. In Sybase what is the syntax for this? There are occasions where Table1 will have records that will not yet exist in Table2, but I still want the statement to return the data in Table1, just missing the data from Table2?
 
SELECT table1.plunum,table2.xrefnum,table1.price
FROM Table1
LEFT OUTER JOIN Table2 on (Table2Plunum=Table1.plunum)
WHERE table1.plunum = '00080521507'

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top