stytax_error:第1:1:未在位置1指定的列名称

发布于 2025-01-27 02:05:47 字数 311 浏览 1 评论 0原文

我正在尝试将以下查询返回表中,但是我会收到此错误

stytax_error:第1:1:未在位置1上指定的列名。

但是每当我只选择它

SELECT replace(Pharma.Parent_Company, '"', '')
FROM Pharma

没有错误的时候

CREATE TABLE PHARMA_NEW AS SELECT replace(Pharma.Parent_Company, '"', '')
FROM Pharma

I am trying to return the below query into a table but I get this error

SYNTAX_ERROR: line 1:1: Column name not specified at position 1.

But whenever I just select it like

SELECT replace(Pharma.Parent_Company, '"', '')
FROM Pharma

It doesnt have error

CREATE TABLE PHARMA_NEW AS SELECT replace(Pharma.Parent_Company, '"', '')
FROM Pharma

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

阳光下的泡沫是彩色的 2025-02-03 02:05:47

正如错误消息所说,您尚未指定该列的名称,而只有用于创建它的表达式。在某些情况下,没关系,您只需获得一个没有名称或生成名称的结果列,但是在此上下文中,Athena希望您自己选择名称。

因此,更改替换(pharma.parent_company,'“','') repleast(pharma.parent_company,'“'''''')为whyther_column_name_you_want 。

As the error message says, you haven't specified a name for the column, only the expression used to create it. In some contexts, that's OK and you'll just get a result column with no name or a generated name, but in this context Athena wants you to choose the name yourself.

So change replace(Pharma.Parent_Company, '"', '') to replace(Pharma.Parent_Company, '"', '') AS whatever_column_name_you_want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文