SQL - Add up all row-values of one column in a singletable
Posted
by ThE_-_BliZZarD
on Stack Overflow
See other posts from Stack Overflow
or by ThE_-_BliZZarD
Published on 2010-04-13T08:49:35Z
Indexed on
2010/04/13
8:52 UTC
Read the original article
Hit count: 133
Hello Everybody,
I've got a question regarding a SQL-select-query: The table contains several columns, one of which is an Integer-column called "size" - the task I'm trying to perform is query the table for the sum of all rows (their values), or to be more exact get a artifical column in my ResultSet called "overallSize" which contains the sum of all "size"-values in the table. Preferable it would be possible to use a WHERE-clause to add only certain values ("WHERE bla = 5" or something similar).
The DB-engine is HSQLDB (HyperSQL), which is compliant to SQL2008.
Thank you in advance :)
© Stack Overflow or respective owner