select * from car where car_plate not in(select car_plate from cat_action)

解决方案 »

  1.   

    用left outer join可以获得全部的(所有car里面有的)。还可以用字查询,比如
    SELECT * FROM car WHERE car_plate NOT IN (SELECT car_plate FROM car_action)
      

  2.   

    select * from car where car_plate not in(select car_plate from cat_action)
      

  3.   

    SELECT * FROM car,car_action WHERE car.car_plate = car_action.car_plate (+) AND car_action.car_plate  IS NULL;
      

  4.   

    子查询太慢,还是外联快~~SQL SERVER和MYSQL:select * from car left join car_action on car.car_plate = car_action.car_plate where car_action.car_plate is nulloracle语法同楼上