Solved

SQL Left Join

Posted on 2008-10-22
11
1,581 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 143

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 143

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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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
 
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 143

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
error in oracle form 11 52
Not listening to where 1 42
Using Sum with Case When within a query 9 47
Oracle SQL Developer equivalent MS SQL 6 32
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

737 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