数据库第八ti求解答一下

我两张表的法人编号已经建立了联系,但是我不知道如何写出没有贷款的法人编号函数(如果有大shen愿意指导我一下其他题更是感激不尽😭)

img

img

select a.* from 法人表 a left join 贷款表 b on a.法人编号=b.法人编号 where b.法人编号 is null

或者:

select a.* from 法人表 a where not exists (select * from 贷款表 b where a.法人编号=b.法人编号)

实际应用时select后面建议按需编写字段列表,不建议使用*
其它题,会的先做,有问题提出