[英]redshift update query with subquery syntax error
update ca_ger.cln_trans_base
set stock_age=cast(week_starting)-b.min_date
from (
select pon+season_code as p,min(cast(week_starting as date)) as min_date
from ca_ger.cln_trans_base a
where a.gross_sales_value>0
and aseason_code!='0'
group by pon+season_code
) as b;
what can be wrong with the above syntax? 上面的语法有什么问题?
Here's the problem cast(week_starting)
. 这是问题cast(week_starting)
。 You need to cast it as something. 您需要将其投射为某种东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.