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

Issue With Inner Join

Status
Not open for further replies.

likelylad

IS-IT--Management
Jul 4, 2002
388
GB
I am trying to run the following code:
Code:
select h.Header_ID,h.Order_Number,h.Order_Type_ID,l.Line_Number from table1 l Inner Join table2 h on l.Header_ID=h.Header_ID where l.Header_ID=1234567;

but it is giving me the following error
ORA-00933 SQL Command Not Properly Ended

Also I tried the following

Code:
select h.Header_ID,h.Order_Number,h.Order_Type_ID,l.Line_Number from table1 h,table2 l Where l.Header_ID=1234567;

I was only expecting 4 records (as there are only 4 records in l.Header_ID) but it is giving thousands of records.

Thanking in advance for any help received.
 
Sorry figured it out:

Code:
select h.Header_ID,h.Order_Number,h.Order_Type_ID,l.Line_Number from table1 h,table2 l Where h.Header_ID=l.Header_ID And l.Header_ID=1234567;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top