SELECT t.id,m.Rank from t_assess_log t?
LEFT JOIN?
(SELECT @counter:[email protected]+1 AS Rank,id,build_no,UNIT_PRICE as Roll FROM t_assess_log,(SELECT @counter:=0) AS t?
ORDER BY UNIT_PRICE ASC ) m on t.id = m.id where t.id = 164;
?
?
用它就可以实现按需所求~~~