简体   繁体   English

Redshift - 错误:数字类型的输入语法无效

[英]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.

相关问题 类型 json aws dms postgres 的无效输入语法 - invalid input syntax for type json aws dms postgres [Amazon](500310) 无效操作:输入末尾的语法错误 Position: 684; - [Amazon](500310) Invalid operation: syntax error at end of input Position: 684; DBT 数据库错误,无效的 NUMERIC 值:nan - DBT database error, Invalid NUMERIC value: nan 表单识别器自定义 model 失败,文件类型无效 `{"error":{"code":"1000","message":"Invalid input file."}}` - Form Recognizer custom model fails with invalid file type `{"error":{"code":"1000","message":"Invalid input file."}}` ERROR: invalid string enlargement request size 1073741823 (redshift 查询错误) - ERROR: invalid string enlargement request size 1073741823 (redshift Query error) Amazon Redshift 无效操作:列 notation.id 应用于字符类型,该字符不是复合类型; Spring 数据 JPA - Amazon Redshift Invalid operation: column notation .id applied to type character, which is not a composite type; Spring Data JPA 将 pipe 分隔文件导入 Redshift 时出现“无效数字,值‘.’,位置 0,类型:整数” - "Invalid digit, Value '.', Pos 0, Type: Integer" while importing pipe delimited file into Redshift 将时间戳数据从 CSV 插入时间戳数据类型的 Redshift 表列时出错 - Error when inserting timestamp data from CSV into a Redshift table column which is of timestamp data type iOS 错误“JSON 写入 (FIRTimestamp) 中的类型无效” - iOS error 'Invalid type in JSON write (FIRTimestamp)' 语法错误:预期的输入结束但在 - Syntax error: Expected end of input but got "(" at
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM