mysql 条件计算
表A,字段ax,ay,az$time = time();select *,(A.az*7+B.bz) as exp WHERE exp<='.$time.' ORDER BY A.ay;
.... (A.az*7+B.bz)
SQL是从右到左的,所以where的时候exp还没有定义。
试一试 HAVING 应该是可以
select *,(A.az*7+B.bz) as exp HAVING exp<='.$time.' ORDER BY A.ay;