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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outer Joins 1

Status
Not open for further replies.

TimboA

MIS
Jul 12, 2001
38
GB
I need to create a query which extracts data from two tables, something like this :-

select 1.name
,1.code
,2.name
,2.code
from data 1
, data 2
where substr(1.code, 2) = substr(2.code,2) (+)

But, my outer join (+) won't work, I get ORA-00933 SQL Command not properly ended.

I've tried putting in

where (substr(1.code, 2)) = (substr(2.code,2)) (+)

where (substr(1.code, 2) = substr(2.code,2)) (+)

where substr(1.code, 2) = (substr(2.code,2) (+))

with out any success.

Any ideas much appreciated !!!

Tim
 
First of all you can not use numbers as table aliases.

The query may be
select a.name
,a.code
,b.name
,b.code
from data a
, data b
where substr(a.code, 2) = substr(b.code(+),2)


 
Thanks SEM. The table alias as a number thing was a deliberate error (not) in my example just to try and get my problem across. Your advise on the positioning of the (+) has worked though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top