请您原谅我的英语。
我有以下数据:
我需要获取给定OP
中Start_date
列的最大进程。
应该看起来像这样:
我不明白,将不胜感激
答案 0 :(得分:1)
Toad通常与Oracle一起使用,因此我将使用Oracle语法。您可以适应其他数据库。关键是从start_date
中提取日期。
select t.*
from (select t.*,
row_number() over (partition by trunc(start_date) order by start_date desc) as seqnum
from t
) t
where seqnum = 1;