我有 3 个表:phones、phones_state 和 state
电话:
+------------------+
| phone_id | model |
+----------+-------+
| 1 | mot |
| 2 | sam |
+----------+-------+
手机状态:
+---------------------+
| phone_id | state_id |
+----------+----------+
| 2 | 1 |
| 2 | 3 |
| 2 | 5 |
| 1 | 1 |
+----------+----------+
状态:
+------------------+
| state_id | name |
+----------+-------+
| 1 | rec |
| 2 | notre |
| 3 | res |
| 4 | wait |
| 5 | back |
+----------+-------+
我想获取所有处于状态 1 而不是处于状态 5 的手机如何在 mysql 查询中执行此操作?