...
exec('insert into tb2
select * from ('+@sql+')t
where not exists (select 1 from tb2 t2 where t2.id=t.id and t2.connet=t.connet)')
...
exec('insert into tb2
select * from ('+@sql+')t
where not exists (select 1 from tb2 t2 where t2.id=t.id and t2.connet=t.connet)')
...
解决方案 »
- 建表时,如何设置字段的值,默认等于其他两个字段的和?
- 不能往表里添加主键的问题
- SQL数据库对比问题
- 从字符串转换为 datetime 时发生语法错误。
- 请问unix环境下怎样访问sqlserver数据库?谢谢
- 请问能不能 约束 一个 整型 或 浮点 类型 字段 的 最小值 或 最大值 ????????
- 请问数据库中用视图好不好,我怎么总觉得的还不如直接查询来得快??请指教!!
- 将SQL选择出来的某一列数据合并成一行
- How to change date format in a database?
- update cjb set tel=?????+???? where tel=******* ?????????????
- 求一条SQL语句,关于统计销售记录的
- sql 如何替换字段的部分内容
存放在表2时,先判断在表2,是否已经存在,如果不存在就不插入,不存在就插入!