By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,511 Members | 659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,511 IT Pros & Developers. It's quick & easy.

Array and Aggregate Functions

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.