在SQL中
declare @keyword varchar(100)
declare @val varchar(100)
set @keyword = '%asp.net%'
set @val = '%c#%'
select f_Resume_uid, f_Resume_Title, f_Resume,f_Filename from tbl_resume where (f_Resume like + @keyword + ) AND (f_Resume like + @val +)
--select f_Resume_uid, f_Resume_Title, f_Resume,f_Filename from tbl_resume where (f_Resume like '%asp.net%' ) AND (f_Resume like '%c#.net%')
最后一个评论的查询是工作da但是上级查询不起作用可以帮助我解决这个问题。
答案 0 :(得分:1)
这是因为你将select
语句视为字符串,而不是。以下应该有效:
declare @keyword varchar(100)
declare @val varchar(100)
set @keyword = '%asp.net%'
set @val = '%c#%'
select f_Resume_uid, f_Resume_Title, f_Resume,f_Filename from tbl_resume where (f_Resume like @keyword ) AND (f_Resume like @val)
答案 1 :(得分:0)
select f_Resume_uid, f_Resume_Title, f_Resume, f_Filename
from tbl_resume
where f_Resume like @keyword and f_Resume like @val