Re: funstions for parsing words
От | Tony Wasson |
---|---|
Тема | Re: funstions for parsing words |
Дата | |
Msg-id | 6d8daee30507191200ca398d1@mail.gmail.com обсуждение исходный текст |
Ответ на | funstions for parsing words (John Kopanas <john.kopanas@protoseinc.com>) |
Список | pgsql-sql |
On 7/19/05, John Kopanas <john.kopanas@protoseinc.com> wrote: > I have a table called Phrases that holds the text of a phrase. I want > write a query that will return all the words found in all the text of > the Phrases. Like so: > > > Phrases: > ------------ > "Hello World" > "Goodbye World" > "I like candy > > Words (select statement result): > ------------ > "Hello" > "World" > "Goodbye" > "I" > "Like" > "Candy" > > Is anything like this possible? > > Thanks alot. > > Your Friend, > > John Kopanas You can do this by using array_to_string and using a space as your delimiter. If you need to trim the quotes use the trim function also. You can also see the split_on_commas example below -- you'd want to split on a space. I would also rewrite this to use array_to_string or use pl/perl if you can. http://archives.postgresql.org/pgsql-sql/2005-05/msg00204.php Hope this helps. Tony Wasson
В списке pgsql-sql по дате отправления: