Hi!
I have two tables, I will call them first-half and second-half (of the year)
Table: first
id jan feb mar apr
-----------------------
2 80 90 70 60
3 50 40 60 30
Table: second
id jan feb mar apr
-----------------------
2 50 70 60 90
3 80 60 50 40
I want to do a SELECT that will bring a total of each individual values (jan, feb, mar, apr) from these tables. Fetch by id. I want something like this:
Table: total
id jan feb mar apr
-----------------------
2 130 160 130 150
How can I make this possible?
ALSO, I will be so thankful if, in that SELECT statement, I can specify the columns I want as comma separated values, that is, I will not always have to pull values of all columns (jan,feb,mar,apr) but I will choose which values I want (say jan,mar,apr) and this is specified as a result of another SELECT statement which will bring required columns, separated by commas (like: jan,mar,apr)
The goal then, is to generate a report (from VB.NET) that shows all this information from table first, second and total
Thank you.