Let\'s say we have the following table structures:
documents docmentStatusHistory status +---------+ +--------------------+ +----------+ | doc
seems to be a duplicate of this question
check out Tom Kyte's take on that