📜  postgresql left join distinct on - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:14.609000             🧑  作者: Mango

代码示例1
Select Distinct On (u.username, u.email)
     u.username
    ,u.email
    ,l.browser
    ,l.login_time
From users u
Join logins l On l.username = u.username
Order By u.username, u.email, login_time Desc
 
                                        ^