[英]MsSql: How to pass a parameter in query in the 'LIKE' Operator instead of a static value
You can use variables to assign values to them. 您可以使用变量为它们分配值。 Passing then into a stored procedure is a common process and the syntax is below. 然后将其传递到存储过程是一个常见过程,语法如下。
CREATE PROCEDURE Test(@Customer NVARCHAR(150))
AS
Select Url from UrlTable where Url LIKE '%'+@Customer+'%'
您可以在oracle中使用如下查询
Select Url from UrlTable where Url LIKE '%' || :customer || '%';
Can you try the following; 您可以尝试以下方法吗?
DECLARE @Customer nvarchar(50) = [value_to_filter];
Select Url from UrlTable where Url LIKE '%' + @customer + '%';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.