[英]BigQuery: Scalar subquery produced more than one element
這個查詢完美地運行了好幾個月,突然之間,開始拋出:標量子查詢產生了多個元素
select event_id, user_id, created_at, company_id, message_id, conversation_id, message_text, 'sent' as message_direction, created_at as message_read_at from message_sent
union all
select distinct e.event_id, e.user_id, e.created_at, e.company_id,
e.message_id, e.conversation_id,
e.message_text, 'received' as message_direction,
min(c.created_at) as message_read_at
from message_received e
left outer join conversation_read c on (e.conversation_id=c.conversation_id and c.created_at > e.created_at)
group by e.event_id, e.user_id, e.created_at, e.company_id,
e.message_id, e.conversation_id,
e.message_text, message_direction
會是什么呢?
深入挖掘后發現。
這個查詢不是問題,而是查詢中使用的視圖。 調試視圖定義后,我發現它的子查詢有問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.