sql server 2005中使用with实现递归

WITH fw_requestion_note_temp(old_apply_id)
AS
(
--取根节点放入临时表
SELECT old_apply_id FROM fw_requestion_note --WHERE old_apply_id = 'e741470e-8b5c-4f91-9b03-c7474d103aef'
--根据已取到的数据递归取其字节点的数据
    UNION ALL
SELECT fw.old_apply_id FROM fw_requestion_note fw INNER JOIN fw_requestion_note_temp temp ON fw.apply_id = temp.old_apply_id
)
SELECT old_apply_id FROM fw_requestion_note_temp
上一篇:linux shell根据端口返回进程号杀死进程的方法


下一篇:Docker容器使用问题:Failed to get D-Bus connection