Home > Database > Mysql Tutorial > body text

ACCESS 通配符问题

WBOY
Release: 2016-06-07 15:42:31
Original
1155 people have browsed it

今天做了个小练习碰到一个 问题 如下 在ACCESS里面 *代表任意多个字符 所以我用.NET 做程序的时候这么写 string strsql=select * from infor where types like '*52*' 然后用.NET执行这句SQL 语句结果不行! 我有分别试了下面两句还是不行。 string strsql=@

今天做了个小练习碰到一个问题如下

在ACCESS里面 *代表任意多个字符

所以我用.NET 做程序的时候这么写

string strsql=select * from infor where types like '*52*'

然后用.NET执行这句SQL 语句结果不行!

我有分别试了下面两句还是不行。

string strsql=@select * from infor where types like '*52*'

string strsql=select * from infor where types like '%52%'

最后我用了

string strsql=@select * from infor where types like '%52%'

 

我想问问既然在ACCESS里面 可以用* 匹配符,为什么.NET这么写(第一条,第三条)招不到数据,反而第最后条能找到数据?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template