• <legend id='l3L0L'><style id='l3L0L'><dir id='l3L0L'><q id='l3L0L'></q></dir></style></legend>

      1. <small id='l3L0L'></small><noframes id='l3L0L'>

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

        SQL 连接子查询

        时间:2023-10-09

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

          <bdo id='AZKhE'></bdo><ul id='AZKhE'></ul>
        • <tfoot id='AZKhE'></tfoot>

                  <tbody id='AZKhE'></tbody>
                <i id='AZKhE'><tr id='AZKhE'><dt id='AZKhE'><q id='AZKhE'><span id='AZKhE'><b id='AZKhE'><form id='AZKhE'><ins id='AZKhE'></ins><ul id='AZKhE'></ul><sub id='AZKhE'></sub></form><legend id='AZKhE'></legend><bdo id='AZKhE'><pre id='AZKhE'><center id='AZKhE'></center></pre></bdo></b><th id='AZKhE'></th></span></q></dt></tr></i><div id='AZKhE'><tfoot id='AZKhE'></tfoot><dl id='AZKhE'><fieldset id='AZKhE'></fieldset></dl></div>
                <legend id='AZKhE'><style id='AZKhE'><dir id='AZKhE'><q id='AZKhE'></q></dir></style></legend>
                  本文介绍了SQL 连接子查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我尝试寻找我的问题的答案,但未能得到真正有帮助的答案.我写了一个 sql 代码,但似乎无法找到问题所在.是否可以在FROM"部分中放置子查询?

                  I tried searching for an answer to my problem but failed to get an answer that actually helped. I've written an sql code but can't seem to find where the problem is. Is it possible to put a subquery in the "FROM" section?

                  SELECT S2.ITEM,
                         S1.SHOP_ORDER,
                         S1.OPERATION_NO,
                         S1.START_DATE,
                         S1.QTY_GOODS,
                         S1.QTY_ENTERED,
                         S1.QTY_MRB
                  FROM   (SELECT SHOP_ORD_RPT.OPERATION_NO,
                                 SHOP_ORD_RPT.SHOP_ORDER
                          FROM   FLAME.SHOP_ORD_RPT
                          WHERE  SHOP_ORD_RPT.OPERATION_NO = 110
                                  OR SHOP_ORD_RPT.OPERATION_NO = 370) AS S1
                         JOIN (SELECT SHOP_ORD.SHOP_ORDER
                               FROM   FLAME.SHOP_ORD
                               WHERE  SHOP_ORD.ITEM = '3A2375'
                                       OR SHOP_ORD.ITEM = '3A2703')AS S2
                           ON S1.SHOP_ORDER = S2.SHOP_ORDER; 
                  

                  我在运行脚本时收到的错误是:

                  The error I receive upon running the script is:

                  SQL 命令没有正确结束

                  SQL command not properly ended

                  如果有人可以提供帮助,我将不胜感激.非常感谢你-露丝

                  I'd appreciate if anyone can help. Thank you very much- Ruth

                  推荐答案

                  Try to remove AS keywrod after FROMJOIN 子查询如下

                  Try to remove AS keywrod after FROM and JOIN subquery as below

                  SELECT S2.ITEM, S1.SHOP_ORDER, S1.OPERATION_NO, S1.START_DATE,S1.QTY_GOODS, S1.QTY_ENTERED, S1.QTY_MRB
                  FROM (
                      SELECT SHOP_ORD_RPT.OPERATION_NO, SHOP_ORD_RPT.SHOP_ORDER
                      FROM FLAME.SHOP_ORD_RPT
                      WHERE SHOP_ORD_RPT.OPERATION_NO =110
                      OR SHOP_ORD_RPT.OPERATION_NO =370
                      )  S1
                  JOIN (
                      SELECT SHOP_ORD.SHOP_ORDER
                      FROM FLAME.SHOP_ORD
                      WHERE SHOP_ORD.ITEM ='3A2375'
                      OR SHOP_ORD.ITEM ='3A2703'
                      )  S2
                  ON S1.SHOP_ORDER = S2.SHOP_ORDER;
                  

                  这篇关于SQL 连接子查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:LEFT JOIN 订单和限价 下一篇:这个(规范化的)数据库结构是否允许我按照我的意图按标签进行搜索?

                  相关文章

                    • <bdo id='v2n2w'></bdo><ul id='v2n2w'></ul>

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

                  1. <small id='v2n2w'></small><noframes id='v2n2w'>

                  2. <tfoot id='v2n2w'></tfoot><legend id='v2n2w'><style id='v2n2w'><dir id='v2n2w'><q id='v2n2w'></q></dir></style></legend>