Given a table with a column of varchar(max), I want to find all rows have a certain sub string that occurs more than once.
row 1: hello test world
row 2: hello world hello
row 3: hello test world test
row 3: hello test test test
I want to find all rows that contain the sub string 'test' at least twice, so rows 3 and 4 only in this case.
A simple attempt:
select * from mytable where mycol like '%test%%test%'
No real idea how to proceed beyond that.
Any help appreciated!