Hi...
I'm currently working on a document system and I'm having trouble with my inner joins and stuff.
Table 1:
ID Heading_Title
1 General
2 Another Section Heading
3 Another Heading
etc...
Table 2:
HeadingID, SubHeadingID, SubHeading_Title
1 1 Sub Heading 1
1 2 Sub Heading 2
2 1 Sub Heading 3
3 1 Sub heading 4
3 2 Sub Heading 5
etc...
Table 3:
HeadingID SubHeadingID Content
1 1 <ntext>
1 2 <ntext>
2 1 <ntext>
etc...
I'm trying to match the heading_title and the sub_title to the IDs stored in table 3.
Here's what I've tried:
SELECT * from table3
inner join table2 on table2.subheadingID = table3.subheadingID
inner join table1 on table3.headingID = table1.ID
And it's throwing up multiple results for the same thing. I'm totally new to this SQL lark and it's doing my head in...
Not the most eloquent explanation in the world... If I've not been clear enough, lemme know...
Any help would be much appreciated...
Thanks.
I'm currently working on a document system and I'm having trouble with my inner joins and stuff.
Table 1:
ID Heading_Title
1 General
2 Another Section Heading
3 Another Heading
etc...
Table 2:
HeadingID, SubHeadingID, SubHeading_Title
1 1 Sub Heading 1
1 2 Sub Heading 2
2 1 Sub Heading 3
3 1 Sub heading 4
3 2 Sub Heading 5
etc...
Table 3:
HeadingID SubHeadingID Content
1 1 <ntext>
1 2 <ntext>
2 1 <ntext>
etc...
I'm trying to match the heading_title and the sub_title to the IDs stored in table 3.
Here's what I've tried:
SELECT * from table3
inner join table2 on table2.subheadingID = table3.subheadingID
inner join table1 on table3.headingID = table1.ID
And it's throwing up multiple results for the same thing. I'm totally new to this SQL lark and it's doing my head in...
Not the most eloquent explanation in the world... If I've not been clear enough, lemme know...
Any help would be much appreciated...
Thanks.