房间:
+---------+---------+-----------+-------------+-------------+-------------+---------+
| room_id | room_no | room_stat | room_name | player_a_id | player_b_id | turn_of |
+---------+---------+-----------+-------------+-------------+-------------+---------+
| 1 | 1 | 0 | blah | 0 | 0 | 0 |
| 2 | 5 | 0 | second room | 1 | 3 | 0 |
| 3 | 3 | 0 | 3rd room | 0 | 0 | 0 |
| 4 | 4 | 0 | 4th room | 0 | 0 | 0 |
+---------+---------+-----------+-------------+-------------+-------------+---------+
我想计算那个房间里有多少玩家,例如:
- 如果 player_a_id !=0 或 !NULL AND player_b_id !=0 或 !NULL 则计数为2
- 如果只有 player_a_id!=0 或 player_b_id!=0 则计数为1
- 否则如果 player_a_id 和 player_b_id 都是 NULL 则返回0;