I'd like to use subqueries and calculation at the same time for my sql project I have a table A where has the following information:
Table A
Month_revenue Income Cost
-------------------------
Jan 100 50
Feb 90 60
Mar 80 40
And I'd like to find the contribution margin for Jan, Feb and the difference of the contribution margins between Jan and Feb. Can I do that in one query and how?
The display should have the following format:
Jan Feb Mar Jan/Feb Feb/Mar
---------------------------------------------------------------
100-50 90 - 60 80-40 (100-50) - (90-60) (90-60) - (80-40)
Thanks!