MySQL select statement with alias fails with column not found
问题 Development Environment Reference: Fedora FC18 Tomcat Server 7.0.39 (localhost config) Eclipse Juno Release 2 Mysql-connecor-java Ver. 5.1.26 (jar) Mysql-server Ver. 5.5.32 (jar) The following select statement fails with "column 'depth' not found": "select node.subEntityID, node.lft, node.rgt, (count(parent.subEntityID) - 1) as depth from ENTITY as node, ENTITY as parent where node.lft between parent.lft and parent.rgt group by node.subEntityID order by node.lft"; This select statement