Sql select rows containing part of string

后端 未结 3 1403
北恋
北恋 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:29

    SELECT *
    FROM myTable
    WHERE URL = LEFT('mysyte.com/?id=2®ion=0&page=1', LEN(URL))
    

    Or use CHARINDEX http://msdn.microsoft.com/en-us/library/aa258228(v=SQL.80).aspx

提交回复
热议问题