Re:

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "ram subbu" <ramgv80(at)yahoo(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re:
Date: 2008-07-17 07:59:12
Message-ID: 162867790807170059y7c3f08bcuc639f149ba457cf4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

2008/7/17 ram subbu <ramgv80(at)yahoo(dot)com>:
> Hi All,
> Here i am facing a peculiar scenario. I have a query which always result
> in 3 rows. There are two columns in the query result. I have to make the
> result of 3 rows as a one row
> select * from tab1;
>
> col1---col2
> ---------------
> 1 5
> 2 38
> 3 50
>
> the result should be
>

select array_to_string(array(select col1 || '-' || col2 from tab1), '/');

regards
Pavel Stehule

> col
> ----
> 1-5/2-38/3-50
>
> Is there any possibilities?
>
>

Browse pgsql-general by date

  From Date Subject
Next Message el dorado 2008-07-17 08:33:51 Standard binaries compilier - how to know?
Previous Message Chris 2008-07-17 03:20:11 Re: Default fill factor for tables?