For the M/G/1 queue we study the joint distribution of the number of customers x present immediately before an arrival epoch and of the residual service time ¿ of the customer in service at this epoch. The correlation coefficient (x, ¿) is shown to be positive (negative) when the service time distribution is DFR (IFR). The result for the joint distribution of x and ¿ leads to the joint distribution of x, of the sojourn time s of the arriving customer and of the number of customers z left behind by this customer at his departure. (x, s), (z, s) and (x, z) are shown to be positive; (x, s) and (z, s) are compared in some detail. Subsequently the M/G/1 queue with finite capacity is considered; the joint distributions of x and ¿ and of x and s are derived. These results may be used to study the cycle time distribution in a two-stage cyclic queue.