表模式非常简单item
,category
而且date
。我想查询每个类别的所有项目,但只查询每个类别的MAX日期。
我认为这可以满足您的需求:
select t.*
from (select t.*,
max(date) over (partition by category) as max_date
from t
) t
where date = max_date;
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句