1 SELECT
 2     realname,
 3     a.bj_id,
 4     a.uid,
 5     a.pid,
 6     CASE
 7 WHEN edate IS NULL
 8 AND sdate IS NOT NULL THEN
 9     '正在考试'
10 WHEN sdate IS NOT NULL
11 AND edate IS NOT NULL THEN
12     '已经考完'
13 WHEN sdate IS NULL
14 AND edate IS NULL THEN
15     '缺考学生'
16 END kszt,
17  paper_name,
18  starttime,
19  endtime,
20  sdate,
21  edate,
22  total_score,
23  score,
24  ip,
25  userno
26 FROM
27     (
28         SELECT
29             t1.id AS uid,
30             t1.realname,
31             t1.bj_id,
32             t3.id AS pid,
33             t3.paper_name,
34             t3.starttime,
35             t3.endtime,
36             t3.total_score,
37             t1.userno
38         FROM
39             tm_user t1,
40             tm_paper_class t2,
41             tm_paper t3
42         WHERE
43             t1.bj_id = t2.bjid
44         AND t2.paperid = t3.id
45         AND t2.paperid = 237
46     ) a
47 LEFT JOIN tm_exam_info b ON a.uid = b.uid
48 AND b.pid = 237;

 

相关文章:

  • 2022-02-27
  • 2021-08-07
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-09-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
相关资源
相似解决方案