David Korz
unread,Jun 11, 2010, 8:55:05 PM6/11/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlalchemy
I have a table like such:
CREATE TABLE test (
mykey integer not null,
mydata double precision [2][10]
) without oids;
with a table defn like:
test = Table("test",metadata,
Column("mykey",Integer,nullable=False),
Column("mydata",PGArray(Float))
)
I want to do a query like:
select mykey,sum(mydata[1][1]) from test group by mykey;
In SA I want to do something like:
query = select([test.c.mykey,func.sum(test.c.mydata[1]
[1])],from_obj=[test]).group_by(test.c.mykey)
test.c.mydata can't be indexed so this is illegal. Is there a way I
can access an array element in SA without just putting the actual SQL
text in?