HI !
I am trying to subtract the sum of two different columns on two different tables from each other. If I write my sql as:
Select sum(table1.column1- table2.column2)
from table1, table2;
I get the wrong answer it subtracts the columns before summing them.
So now I have created a stored procedure which brings the results to two different columns in the results table. Now I am trying to write SQL to subtract the two columns from each other in the results table ie
Select tbresults.result1 - tbresults.result2
from tbresults;
but this doesn't work
I am looking for a way to either subtract one column from the other or else a way to solve the inital problem (subtracting two different column sums) PLEASE !!!
I am trying to subtract the sum of two different columns on two different tables from each other. If I write my sql as:
Select sum(table1.column1- table2.column2)
from table1, table2;
I get the wrong answer it subtracts the columns before summing them.
So now I have created a stored procedure which brings the results to two different columns in the results table. Now I am trying to write SQL to subtract the two columns from each other in the results table ie
Select tbresults.result1 - tbresults.result2
from tbresults;
but this doesn't work
I am looking for a way to either subtract one column from the other or else a way to solve the inital problem (subtracting two different column sums) PLEASE !!!