I have this below query. I like to insert only if the row is not present in TABLE1. How can I do that?
INSERT INTO TABLE1 (VEH_YEAR, VEH_MAKE, ACV_VOLUME)
SELECT VEH_YEAR, VEH_MAKE,
(SELECT COUNT(*)
FROM ACV_VEHICLE_DETAILS
WHERE YEAR = table2 .veh_year
AND MAKE = table2 .veh_make
) AS ACV_VOLUME
FROM TABLE2 table2 WHERE VEH_YEAR IS NOT NULL AND VEH_MAKE IS NOT NULL;