| От | Merlin Moncure |
|---|---|
| Тема | Re: element from an array by its index |
| Дата | |
| Msg-id | b42b73150907211129h4a6da399xb6465324266483ef@mail.gmail.com обсуждение |
| Ответ на | Re: element from an array by its index (Sam Mason <sam@samason.me.uk>) |
| Ответы |
Re: element from an array by its index
|
| Список | pgsql-general |
On Tue, Jul 21, 2009 at 10:47 AM, Sam Mason<sam@samason.me.uk> wrote: > On Tue, Jul 21, 2009 at 04:08:51PM +0600, Murat Kabilov wrote: >> I would like to know if there is a function that extracts an element by its >> index from an array? > > No, the syntax most people expect and use would be arr[ndx]. If you > want a function, it would be easy to do: > > CREATE FUNCTION array_index(anyarray,int) > RETURNS anyelement IMMUTABLE > LANGUAGE sql AS $$ > SELECT $1[$2]; $$; but, why would you write a function to do this? merlin
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера