Solved

SQL Left Join

Posted on 2008-10-22
11
1,574 Views
Last Modified: 2013-12-07
What's wrong with this SQL statement?

Whenever I try and run it I get an "ORA-00933: SQL command not properly ended" error.

I've tried it with and without the semi-colon at the end.
SELECT *

FROM S_ORG_EXT T1

LEFT JOIN S_ORG_EXT_X T4 ON (T1.row_id = T4.row_id);

Open in new window

0
Comment
Question by:Compmouse
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22777115
the * is not allowed like that:
SELECT T1.*, T4.*
FROM S_ORG_EXT T1
LEFT JOIN S_ORG_EXT_X T4 ON T1.row_id = T4.row_id
;

Open in new window

0
 
LVL 1

Author Comment

by:Compmouse
ID: 22777219
I'm pretty sure it is.  But either way when I put your code in I still got the same error.
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 100 total points
ID: 22777285
well, anyhow, the syntax as you showed it is valid.
how do you use it?
0
 
LVL 32

Expert Comment

by:awking00
ID: 22777290
What happens if you remove the parentheses -
SELECT *
FROM S_ORG_EXT T1
LEFT JOIN S_ORG_EXT_X T4 ON T1.row_id = T4.row_id;
0
 
LVL 1

Author Comment

by:Compmouse
ID: 22777331
I'm actually just typing it into Toad as is then running it.

I get the same error when I remove the parentheses. This is very strange to me that I would be getting this kind of error.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Author Comment

by:Compmouse
ID: 22777549
Well this is even more odd, this works:
SELECT * 

FROM S_ORG_EXT T1, S_ORG_EXT_X T4

WHERE T1.row_id = T4.row_id (+);

Open in new window

0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22777581
your are using oracle 8 or lower, then ...
0
 
LVL 32

Expert Comment

by:awking00
ID: 22777593
What version are you running? That is the old outer join syntax.
0
 
LVL 1

Author Comment

by:Compmouse
ID: 22778575
When I run the following statement:
SELECT * FROM v$version
WHERE banner LIKE 'Oracle%';

It returns:
Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
0
 
LVL 22

Assisted Solution

by:dportas
dportas earned 25 total points
ID: 22778690
No ISO join syntax in 8i, you need to use the proprietary (+) syntax instead.
0
 
LVL 32

Expert Comment

by:awking00
ID: 22780724
>>What's wrong with this SQL statement?<<
So, the answer to that question is nothing as long as you're using 9i or later :-(
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now