user2021539
user2021539

Reputation: 967

Add differences into table

Using this code

SELECT p.recnum
FROM   "project list" p
       left join week01 w
              ON p.recnum = w.recnum
WHERE  w.recnum IS NULL 

I get a list of all RecNum that exist in "Project List" but not in "Week01". Is there a way to then add all of those RecNum into Week01.RecNum as well as set Week01.UserName to "JustMe"?

Upvotes: 0

Views: 19

Answers (1)

juergen d
juergen d

Reputation: 204854

 insert into Week01 (UserName, RecNum)
 select 'JustMe', p.RecNum
 from `Project List` p
 left join Week01 w on p.RecNum = w.RecNum
 where w.RecNum is NULL

Upvotes: 1

Related Questions