Join SQL Server tables on a like statement

后端 未结 4 1256
失恋的感觉
失恋的感觉 2021-02-19 18:56

I am hoping this isn\'t a repeat. I\'ve checked the searches and I can\'t seem to find a clear answer to this.

I have a table that has it\'s primary key set to be a

4条回答
  •  醉酒成梦
    2021-02-19 19:34

    select u.* from urltable
    join statetable s on url like N'%' + (convert(varchar(50),s.stateid) + N'%'
    

    performance is likely to be awful

提交回复
热议问题