Please see the details of this question: phrase split algorithm in PHP
I want to do something similar to this question, but in MySQL instead of PHP...
I have a string in a table:
SELECT `string` FROM `strings`;
----------------------
string
----------------------
"Today is a great day"
----------------------
What I want to do is this:
CREATE TEMPORARY TABLE `phrases`
SELECT `phrase` FROM (.. All possible phrases in table `strings`)
And then I'd be left with this temporary table:
SELECT `phrase` FROM `phrases`;
-------------------------------
phrase
-------------------------------
today
today is
today is a
today is a great
today is a great day
is
is a
is a great
is a great day
a
a great
a great day
great
great day
day
-------------------------------
So basically the same as the question I referenced but in MySQL.