I'm using Access/ASP
I have a navigation heirarchy which is structured as follows (simplified):
Parent Child
0 1
1 2
2 3
The ID's of these are joined with the contents of the site. I'm trying to develop a 'breadcrumb' navigation section so I get
News>Latest>Some Article
My current query is:
SELECT tc.ID, tc.Template, tc.title AS ['level three'],
( tc2.title FROM t_contents AS tc2 WHERE tc2.id = th.parent) AS ['level two'],
(SELECT tc3.title FROM t_contents AS tc3 INNER JOIN t_heirarchy AS th3 ON tc3.id = th3.id WHERE tc3.id = (SELECT th4.parent FROM t_heirarchy AS th4 WHERE th4.id = th.parent)) AS ['level one']
FROM t_contents AS tc INNER JOIN t_heirarchy AS th ON tc.id=th.id
WHERE tc.id=37;
The problem is, as soon as I try to SELECT more than one field in the sub queries, I get an error saying I'm not allowed to SELECT multiple fields in a sub query.
How do I get around this so that I can SELECT the sub level ID's and Templates?
Thanks in advance
Pete
I have a navigation heirarchy which is structured as follows (simplified):
Parent Child
0 1
1 2
2 3
The ID's of these are joined with the contents of the site. I'm trying to develop a 'breadcrumb' navigation section so I get
News>Latest>Some Article
My current query is:
SELECT tc.ID, tc.Template, tc.title AS ['level three'],
( tc2.title FROM t_contents AS tc2 WHERE tc2.id = th.parent) AS ['level two'],
(SELECT tc3.title FROM t_contents AS tc3 INNER JOIN t_heirarchy AS th3 ON tc3.id = th3.id WHERE tc3.id = (SELECT th4.parent FROM t_heirarchy AS th4 WHERE th4.id = th.parent)) AS ['level one']
FROM t_contents AS tc INNER JOIN t_heirarchy AS th ON tc.id=th.id
WHERE tc.id=37;
The problem is, as soon as I try to SELECT more than one field in the sub queries, I get an error saying I'm not allowed to SELECT multiple fields in a sub query.
How do I get around this so that I can SELECT the sub level ID's and Templates?
Thanks in advance
Pete