X
X
xXRustamXx2020-11-15 12:13:49
PostgreSQL
xXRustamXx, 2020-11-15 12:13:49

Enum does not work in the ALL statement?

Hello everyone, I'm trying to get the users that provide ALL services from an array:

SELECT users.id FROM users
LEFT JOIN users_services ON users_services."userId" = users.id 
WHERE users_services."serviceId" = ALL(array[1,31])

But I can't do it, I get an empty result, although there is a user in the table who provides services 1 and 31, what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman, 2020-11-15
SQL

the ALL operator doesn't work that way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question