How to access array element in pgsql after array_agg

Поиск
Список
Период
Сортировка
От Condor
Тема How to access array element in pgsql after array_agg
Дата
Msg-id 5bc9c7090f9638f9ca98f36d43472bbb@stz-bg.com
обсуждение исходный текст
Ответы Re: How to access array element in pgsql after array_agg
Список pgsql-general
Hello,

I wanna ask how I can access array element in array_agg ?

I do select array_agg(ids) from x;
in ids I have int and result is :

        array_agg
       -------------
     {3843,2,3543,33}

I want to access one element or first one direct in sql query like:

select array_agg(ids)[1] from x;

and to receive int value 2

Any hints how I can do it ?

And also for performance did that is good I to do it in SQL or I should
do it in language that I use ? The result in query will return about 2,
3 million rows.


Thank you,

Cheers,
Hristo S.


В списке pgsql-general по дате отправления:

Предыдущее
От: Khangelani Gama
Дата:
Сообщение: Re: pg_restore: custom archiver unexpected end of file , ERROR: missing data for column
Следующее
От: François Beausoleil
Дата:
Сообщение: Re: How to access array element in pgsql after array_agg