我在mariaDB中有以下SQL递归

with recursive supervisor as (
select * from staff where staff_id=6
union
select s.* from staff as s, supervisor as su
where s.staff_id=su.supervisor_id
)
select * from supervisor;


这是执行结果

mysql - SQL递归desc选择-LMLPHP

我如何将顺序更改为降序。

最佳答案

完成时添加ROWNUM,然后在外部ORDER BY ROWNUM DESC上添加SELECT

关于mysql - SQL递归desc选择,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47651877/

10-12 23:53