这样写错了吗,如果错了 正确的该怎么写啊
来源:百度知道 编辑:UC知道 时间:2024/06/02 15:09:33
代码:sql="select * from where name=日不落"
access的数据库
access的数据库
1,日不落是字符串形式的值,所以要加上''
2,name在有些系统中可能是敏感名称,所以要加上[]
所以,完全正确的写法是:
sql="select * from where [name]='日不落'"
where子句中的匹配字符都要加上''
试试用单引号 sql="select * from where name='日不落'"
试试用单引号 sql="select * from where name='日不落'"