PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

Modo corretto di usare NOT IN Postgres

Usa left join per individuare le persone senza veicoli

  Select distinct People.id 
  From People 
  LEFT JOIN Vehicles on        People.id=Vehicles.person_id 
  where Vehicles.person_id is NULL