[英]Redshift - ERROR: Invalid input syntax for type numeric
I use the aws - redshift now,but i got a Error like below when i run this query我现在使用 aws - redshift,但是当我运行此查询时出现如下错误
<Query>
select
row_number() over(partition by nb.roadnumbercode
order by sqrt(power((1.0*cast(ra.latitude as decimal(38,10)))-coalesce(nb.buildingcenterlatitude,0),2)
+power((1.0*cast(ra.longitude as decimal(38,10)))-coalesce(nb.buildingcenterlongitude,0),2)
)) rnum
from dmart.addresses ra join dmart.buildings nb on nb.roadnumbercode = ra.roadnamecode and nb.buildingcenterlatitude is not null and nb.buildingcenterlongitude is not null
limit 30;
Why this error cause?为什么会出现这个错误? How can I fix it?
我该如何解决?
It looks like you are casting the empty string (“”) to a numeric which isn't valid.看起来您正在将空字符串 (“”) 转换为无效的数字。 You need to handle the case where the string is empty, nut just NULL.
您需要处理字符串为空的情况,即 NULL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.