sql语句语法错误?
Dim sqlstr As String = "insert into file3 (njiao) select count(*) from [file] where filename like'%完成第七章翻译%'where fid='完成第七章翻译' "
哪里错了呢?
------解决方案--------------------like后面,where前面都要有空格
而且你这是两个where啊,不可以的,改成where xxxx and xxxxx ,你基本的sql知识也太差了吧
------解决方案--------------------把第二个where改为:and
insert into file3 (njiao)
select count(*) from [file] where filename like'%完成第七章翻译%' and fid='完成第七章翻译'
------解决方案--------------------Dim sqlstr As String = "insert into file3 (njiao) select isnull(count(*),0) from [file] where filename like '%完成第七章翻译%' and fid='完成第七章翻译' "
试试
------解决方案--------------------insert into file3 (njiao) vlaues (select isnull(count(*),0) from [file] where filename like '%完成第七章翻译%' and fid = '完成第七章翻译')
不知道对不对 试试吧