DECLARE @str NVARCHAR(1000)=‘SELECT * FROM dbo.V_MicroUserInfo ‘,@where VARCHAR(1000)=‘ where 1=1‘ DECLARE @Nature VARCHAR(200)=‘河南|周口‘ SET @where+=‘ And ‘‘‘[email protected]+‘‘‘ like ‘‘%‘‘+HuJiString+ ‘‘%‘‘ ‘ SET @[email protected]; PRINT @str EXEC sys.sp_executesql @str SELECT * FROM dbo.V_MicroUserInfo where 1=1 And ‘河南|周口市‘ like ‘%‘+HuJiString+ ‘%‘ AND CvNumber=797024 DECLARE @Nature VARCHAR(200)=‘北京|北京,河北|石家庄,山东|济南‘ SELECT * FROM dbo.V_MicroUserInfo WHERE @Nature LIKE ‘%‘+HuJiString+‘%‘ SELECT * FROM dbo.V_MicroUserInfo where 1=1 And ‘北京|北京,河北|石家庄,山东|济南‘ like ‘%‘+HuJiString+ ‘%‘
时间: 2024-10-10 07:37:50