How to compare if two strings contain the same words in T-SQL for SQL Server 2008?

前端 未结 8 1139
长情又很酷
长情又很酷 2021-01-18 05:22

When I compare two strings in SQL Server, there are couple of simple ways with = or LIKE.

I want to redefine equality as:

If

8条回答
  •  囚心锁ツ
    2021-01-18 06:02

    There is no simple way to do this. You are advised to write a function or stored procedure that does he processing involved with this requirement.

    Your function can use other functions that split the stings into parts, sort by words etc.

    Here's how you can split the strings:

    T-SQL: Opposite to string concatenation - how to split string into multiple records

提交回复
热议问题