SELECT qanswers.id,qanswers.question_id,qanswers.answer,users.nickname AS replier,
users.groupname,IF(users.groupname='teacher',TRUE,FALSE) AS isTeacher
FROM fa_user_question_answer AS qanswers
LEFT JOIN fa_users AS users ON users.id=qanswers.user_id
WHERE qanswers.question_id=11
[置顶] Mysql sql查询时 if 的用法
最新推荐文章于 2023-10-08 09:12:52 发布