时间:2021-07-01 10:21:17 帮助过:6人阅读
SELECT * FROM rsl a, (SELECT CODE, max(time_key) time_key FROM rsl GROUP BY CODE ) b WHERE a. CODE = b. CODE AND a.time_key = b.time_key AND a. CODE IN (‘HK.00700‘, ‘HK.03888‘);
table :rsl
然后查询出根据每一种的code 中最新的一组数据
工作 巧遇 sql 查询 一组数据中 最新的一条
标签:max 工作 bsp table from group by ble sel code