Looking for an elegant way in PostgreSQL to split sentences contained in a table into sub-sentences, assuming that the delimiter is ' '. I would like to use a recursive query (like here) but I can't build it. Can someone help?
I have the following table:
id1 | yes we can
id2 | beautiful mind
id3 | birds can fly
and I want like to get something like this:
id1 | yes we can
id1 | yes
id1 | we
id1 | can
id1 | yes we
id1 | we can
id2 | beautiful mind
id2 | beautiful
id2 | mind
id3 | birds can fly
id3 | birds can
id3 | can fly
A tutorial is accessible here.