postgresql distinct
snippet in sql

postgresql distinct

user3342

SELECT
	DISTINCT bcolor
FROM
	distinct_demo
ORDER BY
	bcolor;

postgresql left join distinct on

user5929

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
 
                                        ^