select b[1] from foo - Mailing list pgsql-sql

From rony khoury
Subject select b[1] from foo
Date
Msg-id 36414688.F6E97316@apotres.edu.lb
Whole thread Raw
List pgsql-sql

Hello ,

Say I perform the following operations on my postgresql box :

create table foo (a int , b int[]) ;
insert into foo values(1,'{1,2,3}');
select * from foo ;
a | b
---------------
1 | {1,2,3}
select b[2] from foo ;

the question is why can't I execute the following statement , and If I
want to do an add , avg , sum , etc ... on the same element , how can I
do that ?
If someone can provide me with an example on how to do that I will be
gratefull .

thanks ,
Rony .


pgsql-sql by date:

Previous
From: "G.Elangovan "
Date:
Subject: Re: Rules (was: Re: [SQL] How can I optimize...)
Next
From: "G.Elangovan "
Date:
Subject: Re: Rules (was: Re: [SQL] How can I optimize...)