1010011010
V2EX  ›  问与答

[mysql] 怎么以 聚合函数返回值 是否为空 排序?

  •  1
     
  •   1010011010 · Aug 8, 2017 · 2031 views
    This topic created in 3209 days ago, the information mentioned may be changed or developed.
    ...
      select group_concat(...) as foo
    ...
      order by foo is null asc
    

    会返回错误 Reference 'foo' not supported (reference to group function)

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2636 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 15:43 · PVG 23:43 · LAX 08:43 · JFK 11:43
    ♥ Do have faith in what you're doing.