Reading between the lines in the comments above, and your SQL, I would suggest reading up on Oracle's analytic functions.
http://www.orafaq.com/node/55
These are excellent for calculating things that typically need nested sub-queries that perform group functions - i.e. 'give me the running balance of X for each row', 'give me the rank of X out of the total set of data' or simply 'give me the total count of data'.
What makes them hard to grasp at first is that the syntax is complex, as they can do similar queries for partitions of your data set.
In your case you could probably use the COUNT(*) OVER () operation to get the 'height' from your other table.