I am trying to create a simple view using the following query:
SELECT
MAX(row)
,"Email"
,MAX("DateUpdated")
FROM
"Staging"."DuplicateSubscribers"
GROUP BY "Email"
It is throwing the following error:
ERROR: column "max" specified more than once
Can someone explain what I am missing as I have tried this as a query and it worked well.
Try aliasing the selected expressions:
select MAX(row) as max_row,
"Email",
MAX("DateUpdated") as max_dateupdated
from "Staging"."DuplicateSubscribers"
group by "Email"