需求:按某列的最大值取整行数据。
select <include refid="ALL_COLUMNS"/> from ( select <include refid="ALL_COLUMNS"/>, ROW_NUMBER() OVER (ORDER BY TOKEN_RATE DESC) AS rn from <include refid="TABLE_NAME"/> where TOKEN_RATE is not null and ts >= #{time.from} and ts < #{time.to} ) t WHERE t.rn = 1