Is it possible with sql (postgres) to make a query which searches for entries which match any 3 criterias of 5 possible? I am not getting anywhere at the moment and i am stuck.
Plz, help out.
Is it possible with sql (postgres) to make a query which searches for entries
Share
This is a verbose, yet straight-forward solution to this problem:
You could also do tricks with semi-joining an unnested array:
Or by semi-joining a
VALUES(...)expressionHere’s a working example, which I’ve put on SQL Fiddle:
The above will return 2, as it is the only record that matches at least three criteria among
(1, 1, 2, 2, 2)