SELECT e.employees_name,
@rank := @rank + 1 'rank'
FROM employees e
left join pay_order po
on po.employees_id = e.id ,
( SELECT @rank := 0 ) q
ORDER BY
po.deal_number DESC
mysql 排名
最新推荐文章于 2024-09-22 13:58:28 发布
SELECT e.employees_name,
@rank := @rank + 1 'rank'
FROM employees e
left join pay_order po
on po.employees_id = e.id ,
( SELECT @rank := 0 ) q
ORDER BY
po.deal_number DESC