嵌套查询,或者递归查询

使用with as实现嵌套查询和递归查询:

使用WITH AS提高性能简化嵌套SQL

在MySQL中可以使用sql server中可以使用上面的语句进行递归查询

但是在oracle中却不行,oracle中使用下面的语句来进行递归查询:

1 select *
2   from permission_sgdac p
3  start with p.pid = '-1'
4 connect by prior id = pid;

 参考文章: Oracle递归查询

原文地址:https://www.cnblogs.com/a-ray-of-sunshine/p/4635011.html