sql语句是
select a.username,(@rowNum:[email protected]+1) as c,a.integral as 积分
from xs_user a,(Select (@rowNum :=0 ) ) b order by integral DESC,time
我如何在这条sql语句的基础上,查询出用户的用户名,积分。
或者如何在php中获取一下?
------解决思路----------------------
SELECT * FORM
(
select a.username,(@rowNum:[email protected]+1) as c,a.integral as 积分
from xs_user a,(Select (@rowNum :=0 ) ) b order by integral DESC,time
) T
WHERE username='XXX'
这种定义用户变量的写法还是很巧妙的