So if you have a string like:
"lorum ipsum testing with some dummy text lorum woop what testing again."
and you have a database table like:
ID | TESTING
---------------
1 | dummy
2 | lorum
3 | trol
4 | haha
How do I check what value is the most occurring in the string using sql only.
So in this case it would return: 2 | lorum.
At first I thought the LOCATE() function would be useful. I tried for example:
SELECT *, LOCATE(testing, "<<string comes here>>") FROM <table>
Is this possible? If not what would be the best approach?