On Tue, Dec 10, 2002 at 12:27:34PM +0000, Elizabeth O'Neill's Office Mail wrote:
> Hi 
> 
> Can someone please help me.
> 
> I have two tables in my database a complaint table and a resolution table.
> One complaint may have several resolutions. I am trying to build a report
> that will give me the complaint details and all the resolution descriptions
> for a complaint in one text area/row (concated together).
> 
> At the moment it is repeating the complaint details for each resolution.

You could create a PL/pgSQL function that would take the id of the
resolution to query the complaints table and return the concatenation of
all the details.

That way you could just:

SELECT
       id, foo, bar, concat_resolution_details(id)
  FROM
       resolutions;

I'd give it a shot at the function, but you didn't give the structure of
the table.

-Roberto

-- 
+----|        Roberto Mello   -    http://www.brasileiro.net/  |------+
+       Computer Science Graduate Student, Utah State University      +
+       USU Free Software & GNU/Linux Club - http://fslc.usu.edu/     +

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to