Suppose i have these fields:
+--------+----------+-----------+
| id | read_to | read_from |
+--------+----------+-----------+
| 1 | 0 | 0 |
+--------+----------+-----------+
Now let’s say i make simple query like this:
SELECT * FROM `table`
Now i would like to select first those fields WHERE read_to = 1 OR read_from = 1
And then select rest of the data.
So for example if have this kind of structure:
1 - 0 - 0
2 - 1 - 0
3 - 0 - 0
4 - 1 - 1
I would get something like this:
2 - 1 - 0
4 - 1 - 1
1 - 0 - 0
3 - 0 - 0
Here’s a solution that lets you specify condition for “promoted” records.