Skip site navigation (1) Skip section navigation (2)

Re: noobie-ish question - selecting into a string

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Ben Riddell <ben(at)thewhitebear(dot)com>
Cc: sfpug(at)postgresql(dot)org
Subject: Re: noobie-ish question - selecting into a string
Date: 2005-04-25 22:43:32
Message-ID: 200504251543.32347.josh@agliodbs.com (view raw or flat)
Thread:
Lists: sfpug
Ben,

> I'm wading my way through some postgresql that's just a little beyond me
> right now. (PG 7.3.4, PHP 4.3.4, Fedora Core 1)

Well, first off, that's an old version.   8.0.2 is current.  If you're stuck 
with 7.3, upgrade to the latest 7.3 (7.3.9) as there are known bugs in 7.3.4.  
RPMs for Fedora are available.

> $chemical_query = "
> SELECT c.*
> , [this would be where I'm stuck...] as chemical_type_list
> FROM chemical c
> , chemical_chemical_type_map cctm
> WHERE c.chemical_id = cctm.chemical_id
> ORDER BY c.chemical_id
> ";

Custom aggregate.  While this gets easier to do under 7.4, you can do it under 
7.3.  Look in the Docs under "Create Aggregate"; I beleive that there is an 
example of a string concatination aggregate.


-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

In response to

sfpug by date

Next:From: David FetterDate: 2005-04-25 23:12:05
Subject: Re: noobie-ish question - selecting into a string
Previous:From: Ben RiddellDate: 2005-04-25 20:11:20
Subject: noobie-ish question - selecting into a string

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group