我们在写SQL时候,往往会需要格式化或多表联合查询,现在来一个实例看看这个问题
SELECT t.id, t.topic_title AS title,
IF(sch.is_true='1','答案正确','答案错误') as answer,
DATE_FORMAT(sch.create_time, '%Y-%m-%d %H:%i:%s') as createtime
FROM topic t
LEFT JOIN student_commit_history sch
on t.id = sch.