我想知道是否可以在postgresql中向操作员发出请求:
WHERE date = MAX(date)
谢谢
你可以使用order by和limit:
order by
limit
select t.* from t order by t.date desc limit 1;
或者,如果要获取重复项,请使用子查询:
select t.* from t where t.date = (select max(t2.date) from t t2);