Empty string variable matching to LIKE conditions in SQL

前端 未结 2 1073
误落风尘
误落风尘 2021-01-20 04:17

I have a SQL Server table containing a nvarchar(max) column. I ran a query to select every row where this column contains the string \'remove\'. Amongst the res

2条回答
  •  礼貌的吻别
    2021-01-20 04:37

    I think, you should trim the column;

    select itemid, LTRIM(RTRIM(content))
    from objects
    where itemid = 100 and content like '%remove%'
    

提交回复
热议问题