所以我有一个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
这是一个错误,还是有一些深层的原因,为什么第一个不能做?