View previous topic :: View next topic
|
Author |
Message |
Himanshu Khatri
New User
Joined: 11 Jun 2007 Posts: 15 Location: Pune
|
|
|
|
Hi,
I have a table having columns: item number & 52 columns where each column represents 1 column.(1 year =52 weeks). Each 52 columns has number of sales of item.
I have to find through query cumulative sum of sales of particular item.
e.g. When user provides item number 7 & week number 10, SQL should return sum of(column1 + column2 +---+ column7) for item number 7.
TIA |
|
Back to top |
|
|
saptagiri kintali
New User
Joined: 21 Sep 2007 Posts: 20 Location: chennai
|
|
|
|
hi,
try this..
SELECT (COL1 + COL2....) AS NEWCOL FROM <TABE NAME> WHERE <COND..> |
|
Back to top |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
Whoever defined your table that way should really be responsible for answering your question. |
|
Back to top |
|
|
|