【发布时间】:2013-10-30 17:27:12
【问题描述】:
这似乎是我做过无数次的亚马逊红移的简单加入,但它给了我以下错误:
'查询没有返回任何结果。 [SQL 状态=02000]'
这里是sql:
select
campaign_id as product_campaign_id,
count(*) as sends
into table_1
from customer_to_product_campaign
group by
product_campaign_id
;
select
product_campaign_id,
count(*) as opens_total
into table_2
from product_action_oc
where
product_action_type_paid = 'open'
group by
product_campaign_id
;
select
t1.product_campaign_id,
t1.sends,
t2.opens_total
into table_3
from table_1 t1
left join table_2 t2
on t1.product_campaign_id = t2.product_campaign_id
;
附加信息:
-table 1(创建时没有错误)约为 6K 行
-table 2(创建时没有错误)约为 10K 行
- 这些表确实有共同的 product_campaign_id,但这并不重要
谢谢
【问题讨论】:
标签: sql postgresql join amazon-web-services amazon-redshift