Sql select rows containing part of string

后端 未结 3 1406
北恋
北恋 2021-01-04 02:56

I want to write a comparation procedure (t-sql) for site seo.

I have a table with field \'url\' (nvarchar()) that contain a part of site url\'s. Ex: \'mysyte.com

3条回答
  •  走了就别回头了
    2021-01-04 03:40

    You can use the LIKE operator to compare the content of a T-SQL string, e.g.

    SELECT * FROM [table] WHERE [field] LIKE '%stringtosearchfor%'.
    

    The percent character '%' is a wild card- in this case it says return any records where [field] at least contains the value "stringtosearchfor".

提交回复
热议问题