V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
proxytoworld
V2EX  ›  问与答

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

  •  
  •   proxytoworld · Oct 12, 2020 · 1136 views
    This topic created in 2028 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   ·   813 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 22:30 · PVG 06:30 · LAX 15:30 · JFK 18:30
    ♥ Do have faith in what you're doing.