SummerWQM
V2EX  ›  问与答

问个问题啊 如何不用 max 函数 的情况 怎么取最新一条

  •  
  •   SummerWQM · May 24, 2017 · 2413 views
    This topic created in 3285 days ago, the information mentioned may be changed or developed.

    换句话说 右边表 如何只用查询语句 不使用函数 实现呢

    select s.settlement_id,h.updated_at,from_unixtime(max(h.updated_at)) from settlement as s left join settlement_update_history as h on s.settlement_id = h.settlement_id where s.settlement_id= 6383 group by s.settlement_id

    2 replies    2017-05-24 17:40:03 +08:00
    SummerWQM
        1
    SummerWQM  
    OP
       May 24, 2017
    顶一下
    xkx
        2
    xkx  
       May 24, 2017
    top 1
    order by
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   954 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 64ms · UTC 22:18 · PVG 06:18 · LAX 15:18 · JFK 18:18
    ♥ Do have faith in what you're doing.