From: Tarlika Elisabeth Schmitz <postgresql@numerixtechnology.de>
To: pgsql-sql@postgresql.org
Subject: extracting words
Date: Tue, 22 Apr 2008 22:25:04 +0100
Message-ID: <20080422222504.56bdb06d@dick.coachhouse> (raw)
I am not quite sure whether this would be sensible or indeed at
all possible to do in SQL:
TABLE product: product_pk, product_name, department_fk
TABLE product: department_pk, department_name
example data:
SELECT product_pk, department_name, product_name ... LEFT JOIN ...:
1, "cakes & desserts", "apple crumble"
2, "cakes & desserts", "cheese cake"
3, "starters & soups", "french onion soup"
I need to extract the words from department_name and product_name
(words are separated by spaces) and get something like:
1 cakes
1 desserts
1 apple
1 crumble
2 cakes
2 desserts
2 cheese
2 cake
3 starters
3 soups
3 french
3 onion
3 soup
Would it be more sensible to produce a table join and split the result
into keywords programmatically?
--
Best Regards,
Tarlika Elisabeth Schmitz
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: postgresql@numerixtechnology.de
Subject: Re: extracting words
In-Reply-To: <20080422222504.56bdb06d@dick.coachhouse>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox