im new to sql. i tried to make simple subtraction of two columns from two tables. for example:
Table1 = id, amount, value
Table2 = id, amount
how can i subtract amount 1 with amount 2 without adding total amount in each column. because i want to view it in row.. this is what i have tried so far but still fail..
"SELECT ( SELECT amount FROM table1 ) - ( SELECT amount FROM table2 ) AS difference"
btw i want to ask, is there any way that sql can auto generate table or extra column to view the difference / result of subtraction?
thank you