Mac
V2EX  ›  问与答

MariaDB 和 Mysql 的一个很奇怪的区别,怎么破?

  •  
  •   Mac · Oct 21, 2014 · 3806 views
    This topic created in 4243 days ago, the information mentioned may be changed or developed.
    select * from (select id from xx order by id desc) as abc

    这句子查询

    mysql 返回的是降序的id
    MariaDB 返回的却是升序的,非要把 order by 放在子查询外面。这是MariaDB的特性还是有什么开关可以让它兼容在子查询里排序?
    3 replies    2014-10-21 18:47:45 +08:00
    woshixiaomao
        1
    woshixiaomao  
       Oct 21, 2014
    版本问题,旧版的是不支持自查询的,.
    Mac
        2
    Mac  
    OP
       Oct 21, 2014 via Android
    @woshixiaomao 用的是版本10,应该不是版本问题,和子查询无关啊,只是order by有点问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   932 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 21:48 · PVG 05:48 · LAX 14:48 · JFK 17:48
    ♥ Do have faith in what you're doing.