2021年5月6日星期四

Postgressql - is it possible to make distinct on if the two values are true?

I have the following query, and i want to distinct by user id only if value id and type are the same:

SELECT DISTICT ON (us.id) us.id AS id en.type AS type  FROM enrollment AS en  INNER JOIN "user" AS us ON us.id = en.user_id  
https://stackoverflow.com/questions/67424818/postgressql-is-it-possible-to-make-distinct-on-if-the-two-values-are-true May 07, 2021 at 03:31AM

没有评论:

发表评论