[英]Oracle SQL - only last reading before the 1st of next month
So you want something like this?所以你想要这样的东西吗?
select number, to_char(sysdate, 'Mon-YYYY') as month_year,
max(reading) keep (dense_rank first order by modified_date_time desc) as reading
from t
group by number;
The most recent reading for each number along with the current date formatted as Mon-YYYY.每个数字的最新读数以及格式为 Mon-YYYY 的当前日期。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.