Presto 将两列合并为一列并输出为一列



我正在尝试在 presto 中将两列组合在一起。

这是查询的一部分,必须以某种方式设置格式。

SELECT 'Display' AS channel, 
DBM.dated, 
DBM.market, 
DBM.impressions, 
DBM.clicks, 
sum(DBM.amount_spent_EUR)+sum(DBm.platform_fee) as DBM.amount_spent_EUR
FROM 
(
SELECT
DATE_FORMAT(DATE_PARSE(date,'%Y/%m/%d'),'%Y-%m-%d') AS dated, 
trim(SPLIT_PART(insertion_order,'|',3)) AS market, 
sum(cast(impressions as double)) as impressions, 
sum(cast(clicks as double)) as clicks, 
sum(CAST(media_cost_advertiser_currency AS DOUBLE)*1.15) AS amount_spent_EUR,
sum(CAST(media_fee_1_adv_currency AS DOUBLE)*1.15) as platform_fee
FROM ralph_lauren_google_sheet_dbm_data_2  
WHERE dated <= {{days_ago 1}}
GROUP BY 1,2
)DBM 

错误如下:

查询20190814_125505_19433_rcrut失败:第 1:144 行:无关输入 '." 期待 {, ',', '除了', '来自', '组', '有', "相交"、"限制"、"命令"、"联合"、"位置"}

错误是dbm.amount_spent_eur,这个专栏必须像这样出来。 我该如何解决这个问题?

在这种情况下,您可以使用双引号。

as "DBM.amount_spent_EUR"

相关内容

  • 没有找到相关文章

最新更新