Using Postgres.
I have users, which have items. Items have a column “type.” I’m trying to get a list of users, that have items, whose item types are not null, and the count of these “not null” items is exactly 1.
Desired query:
select *
from users
join items
where items.type IS NOT NULL
and the count of (items.type IS NOT NULL) == 1
Let me know if there’s any more information I can provide.
Thanks in advance!
1 Answer