通配符

  % 匹配零个或多个字符

  _ 匹配单个字符

  []  指定范围 ([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. MVC Razor 一些常用的方法

    一.在ASP.NET MVC中,创建视图最典型的方式是调用一个action方法,它使用模型准备视图数据.action方法然后调用控制器的视图方法创建视图. 1 <% Html.RenderAct ...

  2. 上拉、下拉UITableView,交互式 模态弹出(自定义弹出动画)

    部分代码 InteractiveTransition 类继承NSObject: - (instancetype)initWithPresentingController:(UITableViewCon ...

  3. Webfrom基础知识

    MyBeNASP.NET内置对象 (1)简述ASP.NET内置对象. 答:ASP.NET提供了内置对象有Page.Request.Response.Application.Session.Server ...

  4. c中关于#与##的简易使用

    #运算符用于在预编译时,将宏参数转换为字符串 eg. #include <stdio.h>#define CONVERT(f)(#f) void helloworld(){ printf( ...

  5. mysql中函数DISTINCT,group by,CONCAT及GROUP_CONCAT的使用

    一:DISTINCT 在使用mysql时,有时需要查询出某个字段不重复的记录,虽然mysql提供有distinct这个关键字来过滤掉多余的重复记录只保留一条,但往往只用它来返回不重复记录的条数,而不是 ...

  6. 三星ssd转移系统

    1. (正常模式)如果源磁盘小于目标磁盘   第 1 步 . 开始迁移   第 2 步 . 连接目标磁盘  ① 目标磁盘连接后,其状态会显示在屏幕上.  ※ 如果您要连接 mSATA 产品,那么还需要 ...

  7. Oracle中MERGE语句的使用

    Oracle在9i引入了merge命令, 通过这个merge你能够在一个SQL语句中对一个表同时执行inserts和updates操作. 当然是update还是insert是依据于你的指定的条件判断的 ...

  8. C# 给自己的代码 添加上 自己的版权信息

    如何将自己的代码自动添加版权信息 现在大多数公司都规定程序员在程序文件的头部加上版权信息,这样每个人写的文件都可以区分开来,如果某个文件出现问题就可以快速的找到文件的创建人,用最短的时间来解决问题,常 ...

  9. Python爬虫学习:四、headers和data的获取

    之前在学习爬虫时,偶尔会遇到一些问题是有些网站需要登录后才能爬取内容,有的网站会识别是否是由浏览器发出的请求. 一.headers的获取 就以博客园的首页为例:http://www.cnblogs.c ...

  10. 阿里巴巴JAVA常考面试题及汇总答案

    一.String,StringBuffer, StringBuilder 的区别是什么?String为什么是不可变的? 答:   1.String是字符串常量,StringBuffer和StringB ...