SQL Stored Procedure LIKE

后端 未结 7 1887
野的像风
野的像风 2021-02-20 11:38

This is a simple question and I can\'t seem to think of a solution.

I have this defined in my stored procedure:

@communityDesc varchar(255) = NULL
         


        
7条回答
  •  不知归路
    2021-02-20 12:25

    The simplest way to use this variable is:

    SELECT * 
    FROM something
    WHERE ',' + @communityDesc + ',' Like '%,' + AREA + ',%'
    

    this is for tsql, for oracle use || to concatenate strings

提交回复
热议问题