Sql - order by number of conditions fulfilled
Suppose I have a query with multiple conditions that are in an OR relationship like this:
SELECT * FROM TABLE WHERE (c1) OR (c2) OR (c3) OR ...
I don't want the results to be ordered based on the number of conditions they satisfied. This means that records that satisfy c1 and c2 and c3 showed first (3 conditions), then records that satisfy c1 and c2, or c1 and c3, or c2 and c3 (2 conditions), and at the end of the record that satisfy c1 or c2 or c3
+3
source to share