【发布时间】:2020-10-08 15:28:19
【问题描述】:
我有下一个问题:
select CHANNEL , my_date
from table_1 d
where source_data = 'test_5'
and my_date < to_date('27/09/2020','DD/MM/YYYY')
and customer_ID = :param_customer_ID
order by d.my_date asc;
这将显示下一个结果:
我的需要是。有最后一个 my_date 的最后一个 vale 过滤器,按频道分组。我对这个示例的结果必须如下所示:
只有两行。
我试过了:
select CHANNEL , my_date
from table_1 d
where source_data = 'test_5'
and (my_date < to_date('27/09/2020','DD/MM/YYYY') and my_date = max(my_date))
and customer_ID = :param_customer_ID
group by CHANNEL, my_date
order by d.my_date asc;
但是没有,它不起作用,并给我错误
ORA-00934: función de grupo no permitida aquí
00934. 00000 - "group function is not allowed here"
*Cause:
*Action:
Error en la línea: 138, columna: 30
我该怎么办?
问候
【问题讨论】:
标签: sql plsql oracle-sqldeveloper oracle19c