Suppose I have a column containing strings called "Data" (defined as nvarchar(MAX) )
Data contains the following cells:
-------------------------------------
| data |
--------------------------------------
| "test data #item test data #match" |
-------------------------------------
| "test data #test" |
-------------------------------------
I want to create a query that searches for occurrences with #{something}. However the query returns rows with occurences of 2 or more. So would return:
-------------------------------------
| data |
--------------------------------------
| "test data #item test data #match" |
-------------------------------------
Since there are two hashtag items :
e.g.
SELECT * FROM table WHERE data LIKE '%#% AND COUNT > 2
How would I go about writing such query?