看不懂sql
select a.xq, b.*, case when b.id IS NULL then 0 else 1 end checked
from xingQu a left join studentXingQu b on a.id = b.xqId and b.studentId = 2
能解释一下这句sql 什么意思么.
------解决方案--------------------看不懂就应该先去看语法书。
------解决方案--------------------case when b.id IS NULL then 0 else 1 end checked(case when then查这个语法。)
新增一列checked
当B.ID IS NULL checked:0 否则 checked:1