oracle with语句

oracle with语句

下面是一个示例语句:
WITH a AS (SELECT
*
FROM scott.emp),
          b AS (SELECT
*
FROM scott.dept)
  SELECT a.deptno, b.dname, a.empno, a.ename
    FROM a, b
      WHERE a.deptno = b.deptno
        ORDER
BY a.deptno, a.empno;


使用WITH子句有时可以简化FROM子句的复杂性。

你可能感兴趣的:(oracle,sql)