I hated all the things I had toiled for under the sun, because I must leave them to the one who comes after me. (NIV)
And I hated all my labor in which I had toiled under the sun, seeing that I must leave it to the man who will succeed me. [Ps. 49:10.] (AMP)
Yea, I hated all my labour which I had taken under the sun: because I should leave it unto the man that shall be after me. (KJV)