我在PostgreSQL中有一个带有3个字段的表:ebtyp,erdat,v_no。在PostgreSQL的Case语句中使用聚合和布尔值时遇到问题
输入:
我想申请:(case when ebtyp='LA' and erdat=max(erdat) then vbeln end) as Inbound_delivery_number
我不希望过滤或使用LA/AB where子句,因为我不想排除任何行。
输出:
我试过,但它不工作:
select case
when ebtyp='LA' and erdat=max(erdat)
then v_no OVER (PARTITION BY ebtyp)
end as Inbound_delivery_number
from abc.table1;
我们可以使用与布尔函数聚合函数在一个case语句?任何解决方案?
http://meta.stackoverflow.com/questions/285551/why-may-i-not-upload-images-of-code-在那么当灰化-A-问题/ 285557#285557 –