Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Query multuple IN

Author  Topic 

swakpack
Starting Member

3 Posts

Posted - 2012-03-09 : 02:11:17
table 1: ID = B-12
thickness = 35.6

table2: ID2 = A-20
ID3 = B-12

table3: ID2 = X-05
ID3 = A-20

How can I get the thickness using this three tables? this 3 tables must connect.. tnx

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-03-09 : 03:03:59
select *
from table3 as t3
inner join table2 as t2 on t2.ID2 = t3.ID3
inner join table1 as t1 on t1.ID = t2.ID3


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

swakpack
Starting Member

3 Posts

Posted - 2012-03-09 : 03:35:13
Thank you for the quick reply.

**** ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended" ****

I encounter this error after running this code
select * from XOwnsImpliedItems as t3 
inner join XImpliedMatingParts as t2 on t2.oidorigin = t3.oiddestination
inner join JGasket as t1 on t1.oid = t2.oiddestination
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-03-09 : 03:41:57
Sorry but here are MS SQL Server forums and I have no clue what the problem is in oracle.
Better try another forum for oracle.
For example dbforums.com/oracle


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

shaggy
Posting Yak Master

248 Posts

Posted - 2012-03-09 : 03:44:38
Try with semicolon at the end of the query.
Go to Top of Page

swakpack
Starting Member

3 Posts

Posted - 2012-03-09 : 03:54:08
Thank you for the replies..

webfred, it works when I remove the 'as'
thank you for the help.. :)
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-03-09 : 04:10:35
glad to hear it works for you


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -