运营商就3个分别为1,2,3,所以查出来的是3条数据,这3条分别是每个运营商最新的日期
我把运货写成运营商了。。。。。。。。。。
SELECT
`运货商` as 运货商,max(`发货日期`) as 发货日期 FROM `订单` group by `运货商`
select 运营商, max(发货日期) 最新日期 from 表名 group by 运营商
运营商,
max(发货日期) 发货日期
FROM表
group by 运营商
select * from ( select *, row_number() over(partition by 运营商 order by 发货日期 desc) as rn from 表名 ) t where rn=1