表tariff_info, 原始数据: 想要的结果:以start_time时间倒序排序, 以code分类, 查询每一类最新的一条记录 sql: SELECT a.* FROM TARIFF_INFO a, ( SELECT code, MAX (start_time) start_time FROM TARIFF_INFO GROUP BY code ) b WHERE a.start_time = b.start_time AND a.code = b.code ORDER BY a.code…