Skip to content
Advertisement

Postgresql : “OR” does’nt work like I want

I’ve got some problem with my request :

This request work :

This request work :

But when I put an “OR” between the both requests, it doesn’t work :

I’ve tried to put parentheses, but the request still doesn’t work.

Do you have any idea ?

Advertisement

Answer

Becomes easier to read when you use joins:

And now combine them:

Now where is the difference? You had a mistake in your parentheses. The o.id_organisation = a.id_organisation was canceled out by the or-condition.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement