2017-04-05 39 views
0

我嘗試使用下面的查詢,以創建一個簡單的觀點:PostgreSQL的:爲什麼我不能添加兩個MAX這一觀點

SELECT 
MAX(row) 
,"Email" 
,MAX("DateUpdated") 

FROM 

"Staging"."DuplicateSubscribers" 

GROUP BY "Email" 

它拋出以下錯誤:

ERROR: column "max" specified more than once

有人可以解釋我錯過了什麼,因爲我已經試過這個作爲查詢,它運作良好。

+1

嘗試走樣列 – GurV

+0

輝煌!成功了! –

回答

0

嘗試走樣選擇表情:

select MAX(row) as max_row, 
    "Email", 
    MAX("DateUpdated") as max_dateupdated 
from "Staging"."DuplicateSubscribers" 
group by "Email" 
相關問題