从A、B两个表里Select数据到temp表的郁闷问题!
INSERT INTO [temp]
SELECT Table1.id, Table1.name, Table1.sex, 'from Table1'
FROM table1
UNION
SELECT Table2.id, table2.name, table2.sex, 'from Table2'
FROM table2
/*
表temp中有四个字段,id,name,sex,source
Table1、Table2中没有source这个字段,我想用source来标识数据的来源
但上面的语句不能运行,提示 不能在temp中插入重复值
但我的temp表中没有一条记录
我应该如何办?
*/