使用此代码
SELECT p.recnum
FROM "project list" p
left join week01 w
ON p.recnum = w.recnum
WHERE w.recnum IS NULL
我得到“项目列表”中存在但不在“Week01”中的所有RecNum的列表。有没有办法将所有这些RecNum添加到Week01.RecNum中,并将Week01.UserName设置为“JustMe”?
答案 0 :(得分:1)
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