I haven't tried the queries, but just thinking about your post.
If you have equal numbers of units in stock, and stock count is what determines rank, then I can see them being equal or tied. Do you have some other "attribute" that could be used to break the tie.
Example:
Golf tournament
Tiger scores -1 (1 under par)
Bill, Fred and Tom shoot par (E)
Phil shoots +1 (1 over)
Rankings based on scores is
1st Tiger -1
2nd (Bill, Fred and Tom) (E) (tied for 2nd)
3rd Phil +1
How do you break the tie? Closest to the Pin, most Birdies????