错误虽然小,但是在大量的sql查询中排查还是有点困难的
错误示例代
select * from student t where t.id not in (select t.id,t.record from studen t where t.record >90 )
错误解析
select t.id,t.record from studen t where t.record >90
上面的sql,有两列 t.id,t.record
而 not in() 需要的是单列,多行 t.id
正确代码
select * from student t where t.id not in (select t.id from studen t where t.record >90 )