arm cortex a15:如何用SQL语句判断字符串

来源:百度文库 编辑:高校问答 时间:2024/04/29 00:26:37
如何用SQL语句判断一字段里的值含有某一个字符串?

如:表table1的字段:char1
现有字符串mystring,现要判断char1的值中是否含有mystring。
请问如何用SQL语句实现。(用存储过程)

CREATE PROCEDURE sp_temp
(
@mystring nvarchar(50)
)
AS
select * from table1 where xxx like '%@mystring%'

用通配符:
char1 like '%mystring%'

select * from table1 where xxx like '%yyy%'

select *
from table1
where char1 like '%mystring%'
‘%’表示长度大于等于0的任意字符串,而‘?’可以表示一个字符。