Redshift Aginity Workbench - 错误:42703:table_y 中不存在列“XXX”

Posted

技术标签:

【中文标题】Redshift Aginity Workbench - 错误:42703:table_y 中不存在列“XXX”【英文标题】:Redshift Aginity Workbench - ERROR: 42703: column "XXX" does not exist in table_y 【发布时间】:2017-08-18 19:40:57 【问题描述】:

我使用 mysql Workbench 已经有一段时间了,现在我需要在 Aginity 上工作 - 我正在尝试运行一个简单的脚本:

select min(date)
from table_y 
where column_header = "XXX"

但我得到这个错误:

ERROR: 42703: column "XXX" does not exist in table_y

Where 命令在 Aginity 中的工作方式与在 MySQL Workbench 中的工作方式不同吗?我该如何解决这个错误?

【问题讨论】:

【参考方案1】:

所以“=”和“IN”是不同的sql命令。

我认为您原始查询的问题在于您使用的是双引号而不是单引号。

试试这个:

select min(date)
from table_y 
where column_header = 'XXX'

【讨论】:

成功了!我猜 Aginity 和 MySQL Workbench 的区别在于使用 'xx' 与 "xx"【参考方案2】:

我找到了解决办法!

在 Aginity 中,Where 命令的语法似乎与 MySQL Workbench 中的不同。

MySQL 工作台:

Select (*)
From table_a
Where column_a = 2015

敏捷

Select (*)
From table_a
Where column_a in (2015)

【讨论】:

以上是关于Redshift Aginity Workbench - 错误:42703:table_y 中不存在列“XXX”的主要内容,如果未能解决你的问题,请参考以下文章