Compare Columns Where One is Similar to Part of Another

后端 未结 7 1391
再見小時候
再見小時候 2020-12-05 07:35

I\'m trying to write a Select statement where I can see if one column is like part of another.

tblNames 
ID    FullName                   FirstName
1     Mr.         


        
7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 07:54

    Parentheses also would have fixed the issue.

    SELECT ID, FullName, FirstName
    FROM tblNames
    WHERE ('%' + FirstName + '%') not like Fullname
    

提交回复
热议问题