请帮我看这个写在查询分析器里的sql语句
其中变量@studentLike的值为"郭"
select * from studentInformation where studentNumber like ''%'+ @studentLike + '%'' or studentName like ''%'+ @studentLike +'%''
其实我想要表达的意思如下 :
select * from studentInformation where studentNumber like '%郭%' or studentName like '%郭%'
难就难在“@studentLike”是一个变量,同时又要表示成 '%郭%'
create procedure findStudentByLike
@studentLike varchar(50)
as
select * from studentInformation where studentNumber like ''%'+ @studentLike + '%'' or studentName like ''%'+ @studentLike +'%''
go