Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

postgresql left join distinct on

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
 
                                        ^
Source by www.noelherrick.com #
 
PREVIOUS NEXT
Tagged: #postgresql #left #join #distinct
ADD COMMENT
Topic
Name
4+7 =