导入数据时 为避免出现重复数据的Sql语句

insert into tableName select 
top 1 '刘婷婷1',18
where not exists (select 1 from tableName 
where Age = 18 and Name = '刘婷婷1');

inset into 表名 select top 1 (你要插入的数据)

not exists(select 1 from 表名 where 列名=你插入的数据(每一列都这样写))

猜你喜欢

转载自blog.csdn.net/qq_34059765/article/details/84256138
今日推荐