考虑以下查询:
SELECT n.nid,
(select count(*) as count from view_log where id = n.nid) AS the_count,
(the_count + 1) as the_bumped_count
FROM node n
当我运行它时,我得到Unknown column 'the_count' in 'field list'
. 有没有办法解决?似乎the_count
应该在查询中可见并且可以使用,但显然不是。顺便说一句,我也试过SUM(the_count, 1)
,但也失败了。谢谢!