On Thu, Feb 21, 2019 at 12:02 PM Campbell, Lance <lance(at)illinois(dot)edu> wrote:
> Expected Result:
>
> 1 lance admin
>
>
>
> Ignores the second record with lance in it because the first record
> contained admin.
>
>
> Ignoring <> Grouping
Grouping:
SELECT x, array_agg(DISTINCT y ORDER BY y)
FROM (VALUES ('a',1),('a',2),('b',1),('c',2)) vals (x,y)
GROUP BY x;
Ignoring:
SELECT DISTINCT ON (x) x, y
FROM (VALUES ('a',1),('a',2),('b',1),('c',2)) vals (x,y)
ORDER BY x, y;
David J.