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

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

    2. <tfoot id='gSTQD'></tfoot>
        • <bdo id='gSTQD'></bdo><ul id='gSTQD'></ul>

        <legend id='gSTQD'><style id='gSTQD'><dir id='gSTQD'><q id='gSTQD'></q></dir></style></legend>
      1. MySQL 完全加入?

        时间:2023-05-23

          <legend id='ovn9J'><style id='ovn9J'><dir id='ovn9J'><q id='ovn9J'></q></dir></style></legend>
          <tfoot id='ovn9J'></tfoot>

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

                • <small id='ovn9J'></small><noframes id='ovn9J'>

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

                  问题描述

                  限时送ChatGPT账号..

                  以下是我的查询,我想要如下所示的结果.我怎样才能在 mysql 中做到这一点?

                  Following are my query and I want the result as given below. How can I do this in mysql ?

                  SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo
                  FROM Persons
                  FULL JOIN Orders
                  ON Persons.P_Id=Orders.P_Id
                  ORDER BY Persons.LastName
                  

                  结果集需要看起来像这样:

                  The result-set need to look like this:

                  LastName      FirstName     OrderNo
                  Hansen        Ola          22456
                  Hansen        Ola          24562
                  Pettersen     Kari         77895
                  Pettersen     Kari         44678
                  Svendson      Tove   
                                             34764
                  

                  推荐答案

                  MySQL 缺乏对 FULL OUTER JOIN 的支持.

                  MySQL lacks support for FULL OUTER JOIN.

                  因此,如果您想在 MySQL 上模拟完整连接,请查看 这里 .

                  So if you want to emulate a Full join on MySQL take a look here .

                  通常建议的解决方法如下:

                  A commonly suggested workaround looks like this:

                  SELECT  t_13.value AS val13, t_17.value AS val17
                  FROM    t_13
                  LEFT JOIN
                          t_17
                  ON      t_13.value = t_17.value
                  UNION ALL
                  SELECT  t_13.value AS val13, t_17.value AS val17
                  FROM    t_13
                  RIGHT JOIN
                          t_17
                  ON      t_13.value = t_17.value
                  WHERE   t_13.value IS NULL
                  ORDER BY
                          COALESCE(val13, val17)
                  LIMIT 30
                  

                  这篇关于MySQL 完全加入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:LOAD DATA LOCAL INFILE 给出错误 The used command is not allowed 下一篇:mysql 检查数字是否在逗号分隔的列表中

                  相关文章

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

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

                    1. <tfoot id='VUQe2'></tfoot>

                      • <bdo id='VUQe2'></bdo><ul id='VUQe2'></ul>
                    2. <legend id='VUQe2'><style id='VUQe2'><dir id='VUQe2'><q id='VUQe2'></q></dir></style></legend>