Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5140363369A for ; Fri, 31 Jul 2009 17:03:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67420-01 for ; Fri, 31 Jul 2009 20:03:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mail.postgresql.org (Postfix) with SMTP id 4DD05633219 for ; Fri, 31 Jul 2009 17:03:09 -0300 (ADT) Received: (qmail invoked by alias); 31 Jul 2009 20:03:06 -0000 Received: from p5481E49D.dip.t-dialin.net (EHLO [192.168.0.1]) [84.129.228.157] by mail.gmx.net (mp035) with SMTP; 31 Jul 2009 22:03:06 +0200 X-Authenticated: #14269776 X-Provags-ID: V01U2FsdGVkX1/fDmljoeHfCqrh/D6kA4q9mG22X8eL0pGpEmA7oE 8roK1QDsc84RnE Message-ID: <4A734F8A.906@gmx.net> Date: Fri, 31 Jul 2009 22:09:46 +0200 From: Andreas User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: How fetch multiple rows into one text-field? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.68 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=-10 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/167 X-Sequence-Number: 32908 Hi, how can I fetch multiple rows into one text-field? I need the contents of some log-infos condensed into a single text to show in a report. There is a log with a single record per event. The log is like this (log_id, case_id, log_date, log_category, log_notes) I need a date-ordered list of log-date, -category, -notes of all log-events of the same case-id like log_date || ' ' || log_category || ' : ' || log_nots e.g. 20.07.2009 Category 17 : utterly noteworthy notes 21.07.2009 Category 42 : lots more 22.07.2009 Category 17 : still more drivel The report consists of a couple of case-infos and should look like case_id, case_name, case_all_log_events Is there a way to do this? regards andreas