introduce a join to this query, possible?
- by Iain Urquhart
I'm trying to introduce a join to this query:
SELECT `n`.*, round((`n`.`rgt` - `n`.`lft` - 1) / 2, 0) AS childs,
count(*) - 1 + (`n`.`lft` > 1) + 1 AS level,
((min(`p`.`rgt`) - `n`.`rgt` - (`n`.`lft` > 1)) / 2) > 0 AS lower,
(((`n`.`lft` - max(`p`.`lft`) > 1))) AS upper
FROM `exp_node_tree_6` `n`, `exp_node_tree_6` `p`, `exp_node_tree_6`
WHERE `n`.`lft`
BETWEEN `p`.`lft`
AND `p`.`rgt`
AND ( `p`.`node_id` != `n`.`node_id` OR `n`.`lft` = 1 )
GROUP BY `n`.`node_id`
ORDER BY `n`.`lft`
by adding
LEFT JOIN `exp_channel_titles`
ON (`n`.`entry_id`=`exp_channel_titles`.`entry_id`)
after the FROM statement...
But when I introduce it, it fails with "Unknown column 'n.entry_id' in 'on clause'"
Is it even possible to add a join to this query?
Can anybody help, thanks!