Skip to content

Instantly share code, notes, and snippets.

@rizkiandrianto
Created October 11, 2017 13:16
Show Gist options
  • Save rizkiandrianto/a478b4a5ba861a18c854c0a48357efcb to your computer and use it in GitHub Desktop.
Save rizkiandrianto/a478b4a5ba861a18c854c0a48357efcb to your computer and use it in GitHub Desktop.
select * from notification
right join
(select distinct on (n.seatrequestid) seatrequestid, n.id from notification as n) as distinctnotification
on notification.id = distinctnotification.id
where notification.seatrequestid is not null
order by update_date;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment