veejar <[EMAIL PROTECTED]> writes:

> Hello!
> 
> I have such field in my table:
> 
> field1
> -------
> 1
> 2
> 3
> 4
> 5
> 
> 
> I want to get such result from select:
> '1,2,3,4,5' - join all values in field1 with ','
> // result must be varchar.

No sense in writing your own func for this; the feature is already
provided. 

select array_to_string(array(select * from generate_series(1,5)), ',');

 array_to_string 
-----------------
 1,2,3,4,5
(1 row)

> Help to write SELECT-query for this task.

-- 
-------------------------------------------------------------------------------
Jerry Sievers   732 365-2844 (work)     Production Database Administrator
                305 321-1144 (mobil     WWW E-Commerce Consultant

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/

Reply via email to