Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Combining column values across rows
-- Niall Litchfield Oracle DBA Audit Commission UK Legal disclaimer required by my employer **************************************************************************** ** This email contains information intended for the addressee only. It may be confidential and may be the subject of legal and/or professional privilege. Any dissemination, distribution, copyright or use of this communication without prior permission of the addressee is strictly prohibited. **************************************************************************** ** "Maky" <maky_at_lemur.org.uk> wrote in message news:tn55ltbl00t8c2_at_xo.supernews.co.uk...Received on Thu Aug 09 2001 - 12:00:36 CDT
> Hi,
>
> I hope someone here can help me - I know very little about Oracle or SQL,
but
> have found myself involved in a project where no one else knows anything
about
> it either. =/
>
> The problem is that we have a product table which has a many-to-many
relation
> to a category table (joined through a third "parent" table):
>
> [product] ---< [parent] >--- [category]
>
> We want to get a view where each product occupies just one row, and any
multiple
> category values are combined into a single value, eg (concatenating with
commas):
>
> Product Category
> -------------------
> cheese dairy
> cheese solid
> milk dairy
> milk liquid
> beer liquid
>
> will become
>
> Product Category
> -------------------
> cheese dairy, solid
> milk dairy, liquid
> beer liquid
>
> (This is to make it easier to feed to an Inktomi full-text indexer.)
>
> Is there any way to do this, preferably in SQL?
>
> Also, am I right in thinking that creating a view does not take up any
significant storage
> space in the database?
>
> Thanks for any help,
> Maky
>
>
>