通配符

  % 匹配零个或多个字符

  _ 匹配单个字符

  []  指定范围 ([a-f]) 或集合 ([abcdef]) 中的任何单个字符。

  [^] 不属于指定范围 ([a-f]) 或集合 ([abcdef]) 的任何单个字符。

  转义符 []

示例

  'a[a-f,^h-k]c' 匹配  a,c a^c aac abc  acc  adc  aec  afc  ahc  aic  ajc  akc

  'a[a-f]c' 匹配 aac  abc  acc  adc  aec  afc

  'a[^a-f]c' 匹配 a[中间非a-f]c

  'a[a-b,c-d]c' 匹配 a,c  aac  abc  acc adc

  'a[c' 匹配 ac

  'a]c' 匹配 a]c

  'a[[]c' 匹配 a[c

测试代码

 select *
from(
select 'aac' name
union
select 'abc'
union
select 'acc'
union
select 'adc'
union
select 'aec'
union
select 'afc'
union
select 'agc'
union
select 'ahc'
union
select 'aic'
union
select 'ajc'
union
select 'akc'
union
select 'alc'
union
select 'amc'
union
select 'anc'
union
select 'aoc'
union
select 'apc'
union
select 'aqc'
union
select 'arc'
union
select 'asc'
union
select 'atc'
union
select 'auc'
union
select 'avc'
union
select 'awc'
union
select 'axc'
union
select 'ayc'
union
select 'azc'
union
select 'a1c'
union
select 'a2c'
union
select 'a3c'
union
select 'a4c'
union
select 'a5c'
union
select 'a6c'
union
select 'a7c'
union
select 'a8c'
union
select 'a9c'
union
select 'a0c'
union
select 'a-c'
union
select 'a_c'
union
select 'a+c'
union
select 'a=c'
union
select 'a[c'
union
select 'a]c'
union
select 'a{c'
union
select 'a}c'
union
select 'a|c'
union
select 'a\c'
union
select 'a;c'
union
select 'a%c'
union
select 'a,c'
union
select 'a^c'
union
select 'ac'
)container
where name like 'a[[]c'

测试代码

Sqlserver系列(二) 模糊查询 like的更多相关文章

  1. 【SqlServer系列】子查询

    1   概述 1.1  已发布[SqlServer系列]文章 [SqlServer系列]SQLSERVER安装教程 [SqlServer系列]数据库三大范式 [SqlServer系列]表单查询 [Sq ...

  2. LINQ to Sql系列二 简单查询和联接查询

    这一篇文章主要总结LINQ to sql的简单查询(单表查询)和联接查询(多表查询) 单表查询 需求是我们要输出TClass表中的结果.使用了from-in-select语句,代码如下: public ...

  3. 【SqlServer系列】表单查询

    1   概述 如下几个问题,如果你能解决,请继续往下看,若不能解决,请先复习SQL基础知识,再来阅读本篇文章.本篇文章深度中等左右. Q1:表StudentScores如下,用一条SQL语句查询出每门 ...

  4. 【SqlServer系列】表连接

    1   概述 1.1  已发布[SqlServer系列]文章 [SqlServer系列]MYSQL安装教程 [SqlServer系列]数据库三大范式 [SqlServer系列]表单查询 1.2  本篇 ...

  5. 【SqlServer系列】开启Sqlserver远程访问

    1   概述 已发布[SqlServer系列]文章如下: [SqlServer系列]SQLSERVER安装教程 [SqlServer系列]数据库三大范式 [SqlServer系列]表单查询 [SqlS ...

  6. 【SqlServer系列】集合运算

    1   概述 已发布[SqlServer系列]文章如下: [SqlServer系列]SQLSERVER安装教程 [SqlServer系列]数据库三大范式 [SqlServer系列]表单查询 [SqlS ...

  7. 【SqlServer系列】远程访问

    1   概述 已发布[SqlServer系列]文章如下: [SqlServer系列]SQLSERVER安装教程 [SqlServer系列]数据库三大范式 [SqlServer系列]表单查询 [SqlS ...

  8. MyBatis的手动映射与模糊查询

    一.手动映射 当实体类属性与数据库字段名不同时,无法自动映射,导致查询出空值,这时候可以使用手动映射 在select节点添加resultMap属性与resultMap节点建立关系

  9. sqlserver 分页模糊查询

       积少成多 ----  仅以此致敬和我一样在慢慢前进的人儿 问题: 在sqlserver 进行模糊查询,出现问题 最初使用“concat”,进行拼串操作,如下所示: <select id = ...

  10. ASP.NET MVC+EF框架+EasyUI实现权限管理系列(20)-多条件模糊查询和回收站还原的实现

    原文:ASP.NET MVC+EF框架+EasyUI实现权限管理系列(20)-多条件模糊查询和回收站还原的实现 ASP.NET MVC+EF框架+EasyUI实现权限管系列 (开篇)   (1):框架 ...

随机推荐

  1. CSS选择符 新的认识

    以前写选择符,很少使用">"符号,一般都是使用" "空格来代替.我觉得他们都是一样的功能,另一方面是为了方便.毕竟不用按住shift. 例如: .demo ...

  2. UML学习-活动图创建

    活动图(Activity Diagram)可以实现对系统动态行为的建模,主要是将用例细化,即用例内部的细节可以以活动图的方式描述.活动图描述活动的顺序,主要表活动之间的控制流,是内部处理驱动的流程,在 ...

  3. C#管理IIS中的站点

    原文:http://www.knowsky.com/534237.html Microsoft自Windows Vista一起发布了IIS 7.0,这个已经是去年的话题了,随后,由.NET开发的Web ...

  4. 学习使用Vim(一)

    今天下定决心要逐渐脱离IDE的"comfortable zone",学习使用Vim.以前偶尔使用Vim的经历都是很痛苦的,觉得各种不方便和命令复杂难懂.但既然那么多书都推荐使用Vi ...

  5. 并行查询提高sql查询速度

    新项目在使用Oracle开发中遇到测试库千万级数据导致数据慢,除去加索引和存储过程可以明显提速外,使用并行也可以提速 select /*+parallel(a,8)*/ a.* from a 加上/* ...

  6. calc()函数的使用

    calc()函数算是css中的一个另类了,一般来说css都是直接确定的样式,而calc()函数却是可以动态计算,这和css静态的概念有些区别,但这并不妨碍其优秀的性能. 什么是calc()? calc ...

  7. uva 230 Borrowers(摘)<vector>"结构体“ 膜拜!

    I mean your borrowers of books--those mutilators of collections, spoilers of the symmetry of shelves ...

  8. JS 混淆加密

    http://www.javascriptobfuscator.com/Javascript-Obfuscator.aspx http://www.javascriptobfuscator.com/d ...

  9. 如何中途停止RMAN备份任务

    问题背景 如果,你负责的数据库服务器,在RMAN进行全备时,业务又有大量数据要处理,一时间,系统资源直接被耗尽,影响到了业务的正常,你准备怎么处理? 解决办法 [不推荐]当时我们组的另外一个同事在没有 ...

  10. Python load json file with UTF-8 BOM header - Stack Overflow

    Python load json file with UTF-8 BOM header - Stack Overflow 3 down vote Since json.load(stream) use ...