怎么在查询的时候去匹配变量:
比如,查询姓 "王 "的用select * from people where name like '%王 '
但我是用在存储过程中
定议的一个变量,比如
declare @name nvarchar(50)
@name记录的是姓
[email protected]
------解决方案--------------------
declare @name nvarchar(50)
select * from people where name like '% '[email protected]+ ' ' ' '
------解决方案--------------------
declare @name nvarchar(50)
set @name= '王 '
select * from people where name like '% '[email protected]
------解决方案--------------------
like '% '[email protected]
------解决方案--------------------
declare @name nvarchar(50)
select * from people where name like ' ' '% ' ' '[email protected]+ ' ' ' '