<legend id='5gs5q'><style id='5gs5q'><dir id='5gs5q'><q id='5gs5q'></q></dir></style></legend>
    • <bdo id='5gs5q'></bdo><ul id='5gs5q'></ul>
  • <i id='5gs5q'><tr id='5gs5q'><dt id='5gs5q'><q id='5gs5q'><span id='5gs5q'><b id='5gs5q'><form id='5gs5q'><ins id='5gs5q'></ins><ul id='5gs5q'></ul><sub id='5gs5q'></sub></form><legend id='5gs5q'></legend><bdo id='5gs5q'><pre id='5gs5q'><center id='5gs5q'></center></pre></bdo></b><th id='5gs5q'></th></span></q></dt></tr></i><div id='5gs5q'><tfoot id='5gs5q'></tfoot><dl id='5gs5q'><fieldset id='5gs5q'></fieldset></dl></div>
    <tfoot id='5gs5q'></tfoot>
  • <small id='5gs5q'></small><noframes id='5gs5q'>

        Oracle 中的 SQL Server APPLY 相当于什么?

        What is the equivalent of SQL Server APPLY in Oracle?(Oracle 中的 SQL Server APPLY 相当于什么?)

            <tbody id='WLjA6'></tbody>
          • <legend id='WLjA6'><style id='WLjA6'><dir id='WLjA6'><q id='WLjA6'></q></dir></style></legend>

              <tfoot id='WLjA6'></tfoot>

            • <i id='WLjA6'><tr id='WLjA6'><dt id='WLjA6'><q id='WLjA6'><span id='WLjA6'><b id='WLjA6'><form id='WLjA6'><ins id='WLjA6'></ins><ul id='WLjA6'></ul><sub id='WLjA6'></sub></form><legend id='WLjA6'></legend><bdo id='WLjA6'><pre id='WLjA6'><center id='WLjA6'></center></pre></bdo></b><th id='WLjA6'></th></span></q></dt></tr></i><div id='WLjA6'><tfoot id='WLjA6'></tfoot><dl id='WLjA6'><fieldset id='WLjA6'></fieldset></dl></div>

              <small id='WLjA6'></small><noframes id='WLjA6'>

                <bdo id='WLjA6'></bdo><ul id='WLjA6'></ul>

                1. 本文介绍了Oracle 中的 SQL Server APPLY 相当于什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我是 Oracle 的新手.是否有与 SQL Server APPLY 相同的内置关键字?

                  I am new to Oracle. Is there a builtin keyword does the same job of SQL Server APPLY?

                  推荐答案

                  我认为相当于 Oracle 中的 APPLY 子句称为横向 JOIN.Oracle 中的横向连接是将表 A 与输出行的函数 F 连接起来,该函数将 A 的列作为参数.

                  I think the equivalent of the APPLY clause in Oracle is called a lateral JOIN. A lateral join in Oracle is when you join a table A with a function F that outputs rows and this function has columns of A as parameters.

                  让我们用这个设置构建一个小例子:

                  Let's build a small example with this setup:

                  SQL> CREATE OR REPLACE TYPE emp_row AS OBJECT (
                    2     empno NUMBER(4),
                    3     ename VARCHAR(10),
                    4     job VARCHAR(9),
                    5     deptno NUMBER(2)
                    6  );
                    7  /
                  
                  Type created
                  SQL> CREATE OR REPLACE TYPE emp_tab AS TABLE OF emp_row;
                    2  /
                  
                  Type created
                  SQL> CREATE OR REPLACE FUNCTION get_emp_dept(p_deptno NUMBER) RETURN emp_tab IS
                    2     l_result emp_tab;
                    3  BEGIN
                    4     SELECT emp_row(empno, ename, job, deptno)
                    5       BULK COLLECT INTO l_result
                    6       FROM emp
                    7      WHERE deptno = p_deptno;
                    8     RETURN l_result;
                    9  END get_emp_dept;
                   10  /
                  
                  Function created
                  

                  在 Oracle 中横向连接是自动的,没有特殊的关键字:

                  A lateral join is automatic in Oracle, there is no special keyword:

                  SQL> SELECT dept.dname, emp.empno, emp.ename, emp.job
                    2    FROM dept
                    3   CROSS JOIN TABLE(get_emp_dept(dept.deptno)) emp;
                  
                  DNAME          EMPNO ENAME      JOB
                  -------------- ----- ---------- ---------
                  ACCOUNTING      7782 CLARK      MANAGER
                  ACCOUNTING      7839 KING       PRESIDENT
                  ACCOUNTING      7934 MILLER     CLERK
                  RESEARCH        7369 SMITH      CLERK
                  RESEARCH        7566 JONES      MANAGER
                  RESEARCH        7788 SCOTT      ANALYST
                  RESEARCH        7876 ADAMS      CLERK
                  RESEARCH        7902 FORD       ANALYST
                  SALES           7499 ALLEN      SALESMAN
                  SALES           7521 WARD       SALESMAN
                  SALES           7654 MARTIN     SALESMAN
                  SALES           7698 BLAKE      MANAGER
                  SALES           7844 TURNER     SALESMAN
                  SALES           7900 JAMES      CLERK
                  
                  14 rows selected
                  

                  这篇关于Oracle 中的 SQL Server APPLY 相当于什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?(如何将 DBMS_OUTPUT.PUT_LINE 的输出重定向到文件?)
                  How do I get column datatype in Oracle with PL-SQL with low privileges?(如何使用低权限的 PL-SQL 在 Oracle 中获取列数据类型?)
                  Get a list of all functions and procedures in an Oracle database(获取 Oracle 数据库中所有函数和过程的列表)
                  Why cannot I create triggers on objects owned by SYS?(为什么我不能在 SYS 拥有的对象上创建触发器?)
                  Returning result even for elements in IN list that don#39;t exist in table(即使对于表中不存在的 IN 列表中的元素也返回结果)
                  Reset Sequence in oracle 11g(oracle 11g 中的重置序列)

                2. <tfoot id='HvY1h'></tfoot>
                      <bdo id='HvY1h'></bdo><ul id='HvY1h'></ul>

                        <legend id='HvY1h'><style id='HvY1h'><dir id='HvY1h'><q id='HvY1h'></q></dir></style></legend>
                          • <small id='HvY1h'></small><noframes id='HvY1h'>

                              <tbody id='HvY1h'></tbody>
                            <i id='HvY1h'><tr id='HvY1h'><dt id='HvY1h'><q id='HvY1h'><span id='HvY1h'><b id='HvY1h'><form id='HvY1h'><ins id='HvY1h'></ins><ul id='HvY1h'></ul><sub id='HvY1h'></sub></form><legend id='HvY1h'></legend><bdo id='HvY1h'><pre id='HvY1h'><center id='HvY1h'></center></pre></bdo></b><th id='HvY1h'></th></span></q></dt></tr></i><div id='HvY1h'><tfoot id='HvY1h'></tfoot><dl id='HvY1h'><fieldset id='HvY1h'></fieldset></dl></div>