I have a column called ‘comments’, and would like to find all records containing strings in the ‘comments’ column which are an exact substring of any other cell in the same column. These exact substrings must be entire words, ie they should be seperated by a space from the rest of the string of which they are a substring.
I think I need to use something similar to an array function. How is this possible in SQL Server 2005?
Perhaps something like this:
This will find values (words or phrases) that are surrounded by spaces in another value of the same column or are at the beginning or end of another value of the same column.
This particular example produces just one result:
The query will hardly be very efficient, though, to say the least, but, hopefully, might inspire you or someone else to a better idea.