m0_70017508
2022-07-01 15:39
采纳率: 0%
浏览 106

MYSQL 数据多选题答案对比问题

现在有两个表:

表1:question

| id| ltem | right_answer |
| 1 | XX |  ["A","C","D"]  |
| 2 | BB | ["B","C" ] |


表2:report

| id  |qid | answer         |  status      |
| 1   | 1   | ["A","B","C"] | wrong       |
| 2   | 2   | ["B","C" ]    | right      |
| 3   | 1   | ["A","C"]     | past_right |

表2的 status 字段的值 是根据 表2的answer的值 对比表1 right_answer 的值,表2的qid对应表1的id

有3中情况,正确,错误,部分正确(right,wrong,past_right)

mysql 怎么写,根据表2的answer 得出 status?

5条回答 默认 最新

相关推荐 更多相似问题