Search Postgresql Archives

Re:

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

 



Hello

2008/7/17 ram subbu <ramgv80@xxxxxxxxx>:
> 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?
>
>


[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