I need to get a result from two selects, and compare them.
Their values should return 0 or 1, if one of them is 1, then it’s 1.
1 will always have a greater priority than 0.
This:
- 1st returns 0, 2nd returns 1, then it’s 1.
- 1st returns 1, 2nd returns 0, then it’s 1.
- Both returns 1, obviously it’s 1.
- Both returning 0, finally it’s 0.
Just wrap it in another SELECT and use OR. MySQL already treats 1 as true and 0 as false.
Try these: