我必须提取那些没有车并且住在IT中的业主,我们正在谈论" Arthur"。
SELECT * FROM owner, car WHERE city = 'IT' and owner.idOwner != car.idOwnerFK
城市正在运作,但不像第二部分。 我怎样才能解决我的问题?感谢
答案 0 :(得分:3)
您想要从车主那里开车左转。这样的事情应该有效:
select * from owner o
left join car c on o.idOwner = c.idOwnerFK
where o.city = 'IT' and c.idcar is null
答案 1 :(得分:-1)
尝试
SELECT * FROM owner WHERE city = 'IT' and idOwner not in (select idOwnerFK from car)