Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

molts's avatar
Level 2

How to use `NOT` operator in query builder?

For example how can I build a query like this ?

SELECT * FROM users WHERE not (level > 50 and sex = 1);

I don't want to convert it to this manually, I just want to reverse the whole result with the NOT operator. Can I do it with the query builder?

SELECT * FROM users WHERE level <= 50 and sex = 0;
0 likes
2 replies

Please or to participate in this conversation.