In MSSQL, is there a way to count the number of instances of a
substring within a string, so that I can sort by that?
For example:
table tst contains one column: tst_data
if tst_data = "the man with the plan"
I'd want a function that counts the occurances of "the"
count_substring(tst_data,'the') = 2
Basically, I'm making a search engine and I'd like to put the most
relavent hits at the top of the page.