我的代码有什么问题?执行这些行时,我从 Redshift 收到错误消息。
SELECT
COUNT (
DISTINCT (
CASE
WHEN EXISTS(
(
select
1
from
(
select
ci.order_no,
count(ci.booking_location_id) as cnt
from
oms_core_inventory_booking_detail ci
group by
ci.order_no
) cibd
where cibd.cnt > 1
and co.order_no = cibd.order_no
)
) THEN co.order_no
else NULL
END
)
) AS "SP受注数"
from
table co
我收到这样的错误
由于内部错误,不支持这种类型的相关子查询模式
感谢您的到来帮助。
萨利赫