I have two tables. The structure of tables is as follows.
TRAILERS_INVENTORY
- TRAILER_TYPE VARCHAR2(100)
- TRAILER_LENGTH INT
- TRAILER_WIDTH INT
- YEAR_OF_MANUFACTURE INT
NEW_INVENTORY
- NEW_INVENTORY_TYPE_ID INT,
- TRAILER_TYPE VARCHAR2(100),
- TRAILER_LENGTH INT,
- TRAILER_WIDTH INT,
- YEAR_OF_MANUFACTURE INT
I want to list all of the trailers that do not have a NEW_INVENTORY_TYPE_ID. I am using Oracle 9.2.
One approach is to use a set operation along the lines of
SELECT TRAILER_TYPE
FROM TRAILERS_INVENTORY
WHERE TRAILER_TYPE NOT IN (SELECT TRAILER_TYPE,
TRAILER_LENGTH,
TRAILER_WIDTH,
YEAR_OF_MANUFACTURE
FROM TRAILERS_INVENTORY
INTERSECT
SELECT TRAILER_TYPE,
TRAILER_LENGTH,
TRAILER_WIDTH,
YEAR_OF_MANUFACTURE
FROM NEW_INVENTORY);
IS THERE ANOTHER APPROACH AVAILABLE?