Muslim Modi
Grasshopper
Points: 14
More actions
December 14, 2006 at 4:54 am
#103287
select * from table1,table2 where table1.b=+table2.x
i have two tables table1 and table2. table1 has two columns a and b and table2 has x and y.
thanks in advance
John Mitchell-245523
SSC Guru
Points: 148809
December 14, 2006 at 6:30 am
#678050
I assume the "+" is a typo? Your query will return all rows from table1 and table2 where the value of the column b in table1 matches the value of column x in table2. It can (should, really) be written in ANSI compliant syntax like this:
SELECT * FROM table1 m
INNER JOIN table2 n
ON m.b = n.x
Is this a homework question?
John
Loner
SSC-Insane
Points: 21279
December 14, 2006 at 2:05 pm
#678206
The (+) is outer join mostly using in Oracle. It is not ANSI standard.
SELECT * FROM table1, table2 where table1.b = table2.x (+)
It means if x in table2 can't find a match in table1, it would still appear in the output.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply