关于like的用法

表:myTable
字段:strContent nvarchar(100)
检索要求:返回在strContent中A汉字和B汉字相距为4的,并且A和B之间不包含C汉字的记录。
示例:比如:记录A????B*******就是需要返回的(?代表不为C汉字其他任何汉字或字符)
记录
A??C?B*******就是不符合条件的。
---------------------------------------------------------------

select * from mytable where strcontent
like '%A[^C][^C][^C][^C]B%'

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus