PostgreSQL:为什么我不能向这个视图添加两个 MAX
PostgreSQL: Why can't I add two MAX to this view
我正在尝试使用以下查询创建一个简单的视图:
SELECT
MAX(row)
,"Email"
,MAX("DateUpdated")
FROM
"Staging"."DuplicateSubscribers"
GROUP BY "Email"
它抛出以下错误:
ERROR: column "max" specified more than once
谁能解释一下我遗漏了什么,因为我已经尝试将其作为查询,并且效果很好。
尝试为所选表达式添加别名:
select MAX(row) as max_row,
"Email",
MAX("DateUpdated") as max_dateupdated
from "Staging"."DuplicateSubscribers"
group by "Email"
我正在尝试使用以下查询创建一个简单的视图:
SELECT
MAX(row)
,"Email"
,MAX("DateUpdated")
FROM
"Staging"."DuplicateSubscribers"
GROUP BY "Email"
它抛出以下错误:
ERROR: column "max" specified more than once
谁能解释一下我遗漏了什么,因为我已经尝试将其作为查询,并且效果很好。
尝试为所选表达式添加别名:
select MAX(row) as max_row,
"Email",
MAX("DateUpdated") as max_dateupdated
from "Staging"."DuplicateSubscribers"
group by "Email"