首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

sql语句语法异常

2012-04-16 
sql语句语法错误?Dim sqlstr As String insert into file3 (njiao) select count(*)from [file] where

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 = '完成第七章翻译')

不知道对不对 试试吧

热点排行