首页 > 解决方案 > 列中的错误 - Postgres(psycopg2.ProgrammingError:列“sales_ind”的类型为整数,但表达式的类型为字符变化)

问题描述

尝试在 Postgres 中执行以下查询时出现以下错误。

psycopg2.ProgrammingError: column "sales_ind" is of type integer but expression is of type character varying

HINT:  You will need to rewrite or cast the expression.

Column name : sales_ind
Data_type : int

此列具有以下 case 语句的输出:

CASE WHEN ((fl.created > fl.sales_date) = True) THEN 1 ELSE 0 END AS sales_ind

任何人都可以提供帮助。谢谢..

标签: sqlpostgresqlamazon-redshift

解决方案


推荐阅读