注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

老头的博客

天上飞的果然是鸟人

 
 
 

日志

 
 

不同数据库类型导数  

2010-03-19 15:47:09|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

select *  from [;Provider=Microsoft.Jet.OLEDB.4.0;Database=c:\数据文件.mdb;].Student_Answer

 

SELECT * into [ODBC;Driver=SQL Server;Server=.;Uid=sa;Pwd=sa;database=Test].Student_Answer1
FROM [;Provider=Microsoft.Jet.OLEDB.4.0;Database=c:\数据文件.mdb;].Student_Answer

insert into [ODBC;Driver=SQL Server;Server=.;Uid=sa;Pwd=sa;database=Test].Student_Answer
select * FROM [;Provider=Microsoft.Jet.OLEDB.4.0;Database=c:\数据文件.mdb;].Student_Answer
where SubjectId=99


insert into [ODBC;Driver=SQL Server;Server=.;Uid=sa;Pwd=sa;database=Test].Student_Answer
select * FROM [;Provider=Microsoft.Jet.OLEDB.4.0;Database=c:\数据文件.mdb;].Student_Answer
where (cstr(SubjectId)+cstr(StudentId)+cstr(QuestionNo)+cstr(BatchId))<>700500081103143


insert into [ODBC;Driver=SQL Server;Server=.;Uid=sa;Pwd=sa;database=Test].Student_Answer
select * FROM [;Provider=Microsoft.Jet.OLEDB.4.0;Database=c:\数据文件.mdb;].Student_Answer
where (cstr(SubjectId)+cstr(StudentId)+cstr(QuestionNo)+cstr(BatchId)) not in(select cstr(SubjectId)+cstr(StudentId)+cstr(QuestionNo)+cstr(BatchId) from [ODBC;Driver=SQL Server;Server=.;Uid=sa;Pwd=sa;database=Test].Student_Answer)

 

insert into Student_Answer select * FROM [;Provider=Microsoft.Jet.OLEDB.4.0;Database=c:\数据文件.mdb;].Student_Answer where (cstr(SubjectId)+cstr(StudentId)+cstr(QuestionNo)+cstr(BatchId)) not in(select cstr(SubjectId)+cstr(StudentId)+cstr(QuestionNo)+cstr(BatchId) from [;Provider=Microsoft.Jet.OLEDB.4.0;Database=c:\数据文件.mdb;].Student_Answer)


insert into Student_Answer select * FROM [;Provider=Microsoft.Jet.OLEDB.4.0;Database=c:\数据文件.mdb].Student_Answer where CAST(SubjectId AS varchar(100))+CAST(StudentId AS varchar(100))+CAST(QuestionNo AS varchar(100))+CAST(BatchId AS varchar(100))  not in(select CAST(SubjectId AS varchar(100))+CAST(StudentId AS varchar(100))+CAST(QuestionNo AS varchar(100))+CAST(BatchId AS varchar(100)) from [;Provider=Microsoft.Jet.OLEDB.4.0;Database=c:\数据文件.mdb;].Student_Answer)


select cstr(SubjectId)+cstr(StudentId)+cstr(QuestionNo)+cstr(BatchId)
 from[ODBC;Driver=SQL Server;Server=.;Uid=sa;Pwd=sa;database=Test].dbo.Student_Answer


insert into [ODBC;Driver=SQL Server;Server=.;Uid=sa;Pwd=sa;database=Test].Student_Answer
select * FROM Student_Answer where (cstr(SubjectId)+cstr(StudentId)+cstr(QuestionNo)+cstr(BatchId)) not in(
select cstr(SubjectId)+cstr(StudentId)+cstr(QuestionNo)+cstr(BatchId)
 from[ODBC;Driver=SQL Server;Server=.;Uid=sa;Pwd=sa;database=Test].dbo.Student_Answer)

select TN,count(*) from (select cstr(student_id)+cstr(question_no)+cstr(subject_id) as TN from[ODBC;Driver=SQL Server;Server=.;Uid=sa;Pwd=sa;database=Test].tbl_examspotscoreinfo union all select cstr(student_id)+cstr(question_no)+cstr(subject_id) as TN from tbl_examspotscoreinfo) group by TN

  评论这张
 
阅读(157)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017