回复人: wutao411(了缘) ( ) 信誉:100
insert into table1
select * from table2 where id in ('1','2') and date not in (select date from table1 where id in ('1','2'))
insert into table1
select * from table2 where id in ('1','2') and date not in (select date from table1 where id in ('1','2'))
解决方案 »
- 求SQL语句?
- 帮忙看看这个触发器,怎么不能触发啊?
- 怎么使用全文检索,就是Microsoft Search 服务到哪里去找呀,找都找不到,急
- 数据库编程如何获得错误消息?
- 如何让SQL语句不被SQL Server Profiler跟踪分析
- 2005的最后一天散分第二个100,迎接2006的到来
- 如何在windows 2003 server上安装sqlserver 2000的简体中文企业版?
- 新手写的语句有问题,请高手帮查下问题
- 從Access導資料給SQLServer,用循環寫方法慢死了,有SQLSerer DTS的調用方法嗎?
- 请教高手DTS的问题
- 如何复制表的索引和主键、外键等约束?
- 如何将一列中的部分数据拷贝到另一列中?
的时候 table2 中的2004-5-12 2 的信息是插不进table1 表中的!~~
delete table1
insert into table1 select * from table2--orinsert into table1 select * from table2 a where id in ('1','2') and not exists(select 1 from table1 that id=a.id and date=a.date)
and id not in(select id from table1 where id=a.id and date=a.date)
select * from table2 a
where id in ('1','2')
and not exists (select 1 from table1
where id=a.id
and [date]=a.[date])