sql - 列中的错误 - 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
任何人都可以提供帮助。谢谢..
解决方案
推荐阅读
- python - 删除列并将它们附加到现有列
- javascript - 根据来自对象的另一个值将相同的多个对象推送到多个数组中
- python - 自定义迭代numpy矩阵
- angular - 用 jasmine spy 测试 cdk 覆盖
- python - 在列表内的字典中搜索用户
- c# - Session vs User.Identity.Name 使用 Windows 身份验证检查记录的 ASP.net 核心应用程序的用户名
- r - 有没有办法根据匹配标准和距离上次 > 365 天的新事件日期来选择案例?
- microsoft-graph-api - MS Graph API:使用查询参数扩展子项后更改页面大小
- laravel - 如何在 Laravel 5.8 中使用 PHPUnit 的方法设置
- sql - 无法从 varchar 转换为 date