京九铁路广告:ASP中SQL语句问题

来源:百度文库 编辑:中科新闻网 时间:2024/04/28 02:15:28
select * from table where id not like '%T'
select * from table where id like '%[^T]'
select * from table where id not like '%T%'
select * from table where id like '%[^T]%'
select * from table where id like '%T'
select * from table where id like '%[T]'
select * from table where id like '%T%'
select * from table where id like '%[T]%'
谁能给我说清楚点,这样的查法有什么不同!~
每一行都给我说明一下

查询table中id最后一个字母不是T

第二个效果跟第一个是一样
在单字符位置搜索从 a 到 f
的字符,可以用 LIKE '[a-f]' like '[^a-f]' 或者LIKE '[^abcdef]' 表示从单个字符位置搜索除 a 到 f 以外的任何字符。

查询table中id中不包含T
第四个效果跟第三个是一样

查询table中id最后一个字母是T
第六个和第五个效果一样

查询table中id中包含T
第八个和第七个效果一样