所以我有一個Amazon Redshift出價表。每個出價都有描述和出價的用戶,以及我想知道的每個出價,如果用戶在過去5天內使用相同的說明進行了出價。Redshift相關子查詢內部錯誤
查詢看起來是這樣的:
select b1.bid_id, case when
exists(select b2.bid_id from dim_bid b2 WHERE b1.user_id = b2.user_id
and b2.bid_timestamp < b1.bid_timestamp and b2.bid_timestamp > b1.bid_timestamp - INTERVAL '5 day'
and b2.description = b1.description and b2.bid_timestamp > '2017-04-25') then 'good bid' else 'duplicate bid' END
from dim_bid b1
where b1.hidden
不工作,給人的錯誤:this type of correlated subquery is not supported due to internal error
。但是,當我剛剛添加一個「=真」在最後它的作品。
select b1.bid_id, case when
exists(select b2.bid_id from dim_bid b2 WHERE b1.user_id = b2.user_id
and b2.bid_timestamp < b1.bid_timestamp and b2.bid_timestamp > b1.bid_timestamp - INTERVAL '5 day'
and b2.description = b1.description and b2.bid_timestamp > '2017-04-25') then 'good bid' else 'duplicate bid' END
from dim_bid b1
where b1.hidden = True
這是一個錯誤,還是有一些深層的原因,爲什麼第一個不能做?