V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
SummerWQM
V2EX  ›  问与答

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

  •  
  •   SummerWQM · 2017-05-24 16:46:23 +08:00 · 1618 次点击
    这是一个创建于 2519 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    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 条回复    2017-05-24 17:40:03 +08:00
    SummerWQM
        1
    SummerWQM  
    OP
       2017-05-24 16:55:04 +08:00
    顶一下
    xkx
        2
    xkx  
       2017-05-24 17:40:03 +08:00
    top 1
    order by
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1519 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:13 · PVG 01:13 · LAX 10:13 · JFK 13:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.