Search Postgresql Archives

Re: merge result sets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 20, 2006 at 12:06:24 +0200,
  simon <simon.litwan@xxxxxxxxx> wrote:
> hi all
> 
> i'm using postgres 7.3
> 
> my problem is i want to build a helper table:
> 
> UPDATE studienmodul_summary 
>                SET kategorie = (SELECT kategorie_bezeichnung
> 
> if the SELECT gives back just one result row, everthing is easy. my
> problem is, there is sometimes more than one result row. 
> 
> is there a way to concatenate all result rows and insert them in one
> field?

Yes. You can have the subselect call a custom aggregate function that does
this for you. Sample code for doing this has been posted on the list
multiple times and you should be able to find it in the archives.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux