select * from (
select elec,time,Row_Number() OVER (partition by trunc(TIME) order by time) rank from cp_potentiostat_data
where PO_ID=31865561 and trunc(time) > trunc(add_months(sysdate,-3))
) where rank=1
作用:查询近三个月的每天的第一条数据。
Row_Number() OVER (partition by trunc(TIME) order by time)返回对时间分组并排序的一个编号序列,Row_Number() OVER (partition by 【分组字段】order by 【排序字段】)
qq:243638487 邮箱:243638487@qq.com