INSERT INTO TempTime1 (NOM,Tday,Ttime,Ttindex) SELECT * FROM time1 WHERE days AND times NOT IN (SELECT * FROM timetable1_1)
Few things to note here
you are inserting values into 4 columns of TempTime1 table with
select * from time1
where time1 has more than 4 columns,so that's a error
and the second one : SELECT * FROM time1 WHERE days AND times NOT IN (SELECT * FROM timetable1_1)
you can't put 2 columns "days AND times" and say not in.......
and then you are trying to GET times which are not in timetable1_1
you have specify
select times from timetable1_1 as the inner query is returning more than 1 column
try this INSERT INTO TEMPTIME1
SELECT TOTAL.DAYS,TOTAL.TIMES,TOTAL.TINDEX FROM
(SELECT TIME1.DAYS,TIME1.TIMES,TIME1.TINDEX FROM
TIME1
LEFT OUTER JOIN TIMETABLE1_1
ON TIME1.TIMES=TIMETABLE1_1.TIMES
AND TIME1.DAYS=TIMETABLE1_1.DAYS
HAVING (TIMETABLE1_1.TIMES IS NULL AND TIMETABLE1_1.DAYS IS NULL)
)TOTAL