一、今天遇到这么一个功能,要从b,c表中读取一些数据,然后插入a中,但是a中的数据不能重复
解决方法:
INSERT INTO a
select * from
(
从b和c中读取数据
) as tempTable
where tempTable.唯一标示 not in (select 唯一标示 from a )
二、inner join 两个表,然后用得到的数据更新其中一个表
语法:
一、今天遇到这么一个功能,要从b,c表中读取一些数据,然后插入a中,但是a中的数据不能重复
解决方法:
INSERT INTO a
select * from
(
从b和c中读取数据
) as tempTable
where tempTable.唯一标示 not in (select 唯一标示 from a )
二、inner join 两个表,然后用得到的数据更新其中一个表
语法: