我的MySQL schema中,我有<编码>(同上,括号,姓名)编码>表。
在MSSQL中,我有CTE问(从底层为供应型国际发展法建设一类树):
with CTE (id, pid, name)
as
(
select id, parentid as pid,name
from category
where id = 197
union all
select CTE.pid as id , category.parentid as pid, category.name
from CTE
inner join category
on category.id = CTE.pid
)
select * from CTE
如何将这一问答改为我的SQL?