proxytoworld
V2EX  ›  问与答

为什么 MySQL 的 order by 之后跟 union select 会报错?谷歌了一下没发现为什么?

  •  
  •   proxytoworld · Oct 12, 2020 · 1213 views
    This topic created in 2067 days ago, the information mentioned may be changed or developed.
    3 replies    2020-10-12 10:25:12 +08:00
    binux
        1
    binux  
       Oct 12, 2020 via Android
    带个括号试试
    proxytoworld
        2
    proxytoworld  
    OP
       Oct 12, 2020
    @binux 语法问题,MySQL 语法规定不可以,但是我想知道为什么不可以
    cyspy
        3
    cyspy  
       Oct 12, 2020 via Android
    语义上 order by 只有在最外层能得到保证,union 后顺序不保证,order by 就没意义了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   927 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 21:22 · PVG 05:22 · LAX 14:22 · JFK 17:22
    ♥ Do have faith in what you're doing.