使用資料表匯入另一個資料表的方法
INSERT INTO TB_EB_EMPL_HR
SELECT USER_GUID,0,
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','',
GETDATE(),GETDATE(),'',[卡號],'','',''
FROM [TB_EB_TEMP]
INNER JOIN TB_EB_USER on TB_EB_USER.ACCOUNT = TB_EB_TEMP.工號
WHERE USER_GUID not in (select USER_GUID from TB_EB_EMPL_HR)
SELECT USER_GUID,0,
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','',
GETDATE(),GETDATE(),'',[卡號],'','',''
FROM [TB_EB_TEMP]
INNER JOIN TB_EB_USER on TB_EB_USER.ACCOUNT = TB_EB_TEMP.工號
WHERE USER_GUID not in (select USER_GUID from TB_EB_EMPL_HR)
留言