Search Postgresql Archives

Group By question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have a table that looks something like this:

SKU   Dept   Col1   Col2  Col3
-------   ------   -------   -------  ------
1        1        1        2       3
2        1        2        3       4
3        2        1        0       1
4        2        0        1       2
5        2        4        1       3
6        3        1        2       3

I am having a problem trying to get the Is there a query that can do something like this:

select sku, dept, (col1 + col2) * col3) from table group by dept

Ideas?


-Jeff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux