Is is possible to combine the below queries into single, I am basically interested in getting the result given by the last query.
#This is wrong SQL only intended as pseudocode
SELECT sum(amt) u FROM entry WHERE en_type='some_type' AND num='some_num';
SELECT sum(amt) v FROM entry WHERE en_type='some_other_type' AND num='some_num';
SELECT abal x FROM accounts WHERE num='the_same_num_as_above';
SELECT y = x + v - u;
Using subqueries you can do: