Reputation: 304
I have the following SQL Recursion in mariaDB
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;
This is the execution result
How can i change the order into descending.
Upvotes: 0
Views: 82
Reputation: 142306
Add a ROWNUM
as you got through, then ORDER BY ROWNUM DESC
on the outer SELECT
.
Upvotes: 1