1Select Distinct On (u.username, u.email)
2 u.username
3 ,u.email
4 ,l.browser
5 ,l.login_time
6From users u
7Join logins l On l.username = u.username
8Order By u.username, u.email, login_time Desc
9
10 ^
11