470,614 Members | 1,396 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

Array and Aggregate Functions

Hi all!
I'm new in PostgreSQL and I need some help.
I have a table:

MyTable
----------------------
ID | Price | Units
----------------------
1 | 1.27 | 12
2 | 1.12 | 22
3 | 1.12 | 11
4 | 1.27 | 10
5 | 0.99 | 7
----------------------

and I need to count amount:

SELECT SUM(Price*Units) as amount FROM MyTable

but I need knew what IDs were included in each calculated line.
My question: can I create an array and push IDs in it:

SELECT SUM(Price*Units) as amount, {ID} as ids FROM MyTable

Thanks in advanced.
Nov 11 '05 #1
0 1299

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Saurabh Aggrawal | last post: by
28 posts views Thread by Terry Andersen | last post: by
16 posts views Thread by herbertF | last post: by
8 posts views Thread by Andy Kriger | last post: by
8 posts views Thread by jefftyzzer | last post: by
24 posts views Thread by DomoChan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.