打开重复记录的所有字段值并获取离当前时间最近的记录
程序员文章站
2022-04-01 08:52:49
...
方法一:
select o.* from zjx_order o where o.ordertime = (select max(ordertime) from zjx_order group by identitycard having o.identitycard = identitycard )
方法二:
select * from zjx_order where (identitycard,ordertime) in(select identitycard,max(ordertime) from zjx_order group by identitycard )
select o.* from zjx_order o where o.ordertime = (select max(ordertime) from zjx_order group by identitycard having o.identitycard = identitycard )
方法二:
select * from zjx_order where (identitycard,ordertime) in(select identitycard,max(ordertime) from zjx_order group by identitycard )
上一篇: Android部分手机上canvas size不正确的问题
下一篇: 乔布斯传中的英文词频统计