多次模糊查询有没有什么好方法?
想在一列中查找包含字符‘·’,‘#’,‘%’,‘(’,‘)’……的结果有没有什么好方法?
[解决办法]
create table test1(strA varchar(100))insert into test1 select 'abc·defghig' union allselect '12345%67'select * from test1 where CHARINDEX ('·',strA)>0 or CHARINDEX ('%',strA)>0 or CHARINDEX ('(',strA)>0 or CHARINDEX (')',strA)>0
[解决办法]
create table a(b varchar(100)) insert into a select 'qeturojt'select'123%34358' union allselect'1233435#8' union allselect'1(3%34358' union all select'1.3#43)8'select * from a where b like '%.%' or b like '%#%' or CHARINDEX('%',b)>0 or b like '%(%' or b like '%)%' drop table a