首页 > 解决方案 > 红移中的日志功能

问题描述

我正在尝试运行以下查询。

CREATE TEMP TABLE tmp_variables AS SELECT 
   0.99::numeric(10,8) AS y ;

select y, log(y) from tmp_variables

它给了我以下错误。有没有办法解决这个问题?

[Amazon](500310) Invalid operation: Specified types or functions (one per INFO message) not supported on Redshift tables.;
Warnings:
Function "log(numeric,numeric)" not supported.

标签: sqlamazon-redshift

解决方案


一种解决方法是改用“浮动”。

CREATE TEMP TABLE tmp_variables AS SELECT 
   0.99::float AS y ;
select y, log(y) from tmp_variables

工作正常并返回

日志

0.99 -0.004364805402450088


推荐阅读