Ecclesiastes 2:18

Amplified Bible (AMP)
So I hated all the fruit (gain) of my labor for which I had labored under the sun, because I must leave it to the man who will succeed me.

Read Ecclesiastes 2:18 in other translations