proxytoworld
V2EX  ›  问与答

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

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