Select 最后修改的数据记录来自 Table

Select last Modified data record from the Table

这是 table 的样子。我只想 select 只记录 Last Modified Date 为 Max 的记录。例如:将仅 select 上面的第 2 条记录 Table。 可能吗?

使用 order by 和 limit

select a.* from table_name a
order by last_mod_date desc
limit 1

如果即使最大值出现多次也只需要一行,请使用 LIMIT:

select amount, created_date, last_mod_date
from the_table
order by last_mod_date desc
limit 1;

如果最大值出现不止一次,如果你想要多行,你可以使用window函数:

select amount, created_date, last_mod_date
from (
    select amount, created_date, last_mod_date, 
           dense_rank() over (order by last_mod_date desc) as rn
    from the_table
) t 
where rn = 1;