Print Thread
Join-Statements
#32288 03/26/03 06:22 PM
Joined: Mar 2003
Posts: 20
Germany
Member
OP Offline
Member
Joined: Mar 2003
Posts: 20
Germany
Hi,

I would like to do the following select statement:

select iasmatfms.material,
iasmatfms.statmatnum,
iasmatx.stext,
iasmatx.ltext
from iasmatx right outer join iasmatfms on iasmatfms.material = iasmatx.material

to have all items listed in both databases, but it doesn't work. I always get an error "Command not properly ended".

What is the reason?


------------------
--
Rgds,
Norbert


Regards,
Norbert
Re: Join-Statements
#32289 03/27/03 01:08 AM
Joined: Mar 2002
Posts: 9
Minneapolis, MN USA
F
Member
Offline
Member
F
Joined: Mar 2002
Posts: 9
Minneapolis, MN USA
What version is your Oracle Database?
"Right Outer Join" syntax is supported in
Oracle 9i, but not Oracle8i or earlier.

Try this:

select iasmatfms.material,
iasmatfms.statmatnum,
iasmatx.stext,
iasmatx.ltext
from iasmatx,iasmatfms
where iasmatfms.material = iasmatx.material(+)


The (+) on the iasmatx.material column will
preserve that column as a null if no match
is found for iasmatfms.material. You can
simply place the (+) on the other column if
that is the one that should be preserved.

Re: Join-Statements
#32290 04/02/03 03:02 PM
Joined: Mar 2003
Posts: 20
Germany
Member
OP Offline
Member
Joined: Mar 2003
Posts: 20
Germany
Hi,

It is Oracle 8i, but it works with the (+).
Great, and many thanks.

[quote]Originally posted by foldenm:
What version is your Oracle Database?
"Right Outer Join" syntax is supported in
Oracle 9i, but not Oracle8i or earlier.

Try this:

select iasmatfms.material,
iasmatfms.statmatnum,
iasmatx.stext,
iasmatx.ltext
from iasmatx,iasmatfms
where iasmatfms.material = iasmatx.material(+)


The (+) on the iasmatx.material column will
preserve that column as a null if no match
is found for iasmatfms.material. You can
simply place the (+) on the other column if
that is the one that should be preserved.

[/quote]



------------------
--
Rgds,
Norbert


Regards,
Norbert

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.036s Queries: 13 (0.008s) Memory: 2.5010 MB (Peak: 3.0378 MB) Data Comp: Off Server Time: 2024-05-05 22:07:37 UTC
Valid HTML 5 and Valid CSS