Ecclesiastes 2:17-22 Amplified Bible (AMP)

17. So I hated life, because what is done under the sun was grievous to me; for all is vanity and a striving after the wind and a feeding on it.

18. 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.]

19. And who knows whether he will be a wise man or a fool? Yet he will have dominion over all my labor in which I have toiled and in which I have shown myself wise under the sun. This is also vanity (emptiness, falsity, and futility)!

20. So I turned around and gave my heart up to despair over all the labor of my efforts under the sun.

21. For here is a man whose labor is with wisdom and knowledge and skill; yet to a man who has not toiled for it he must leave it all as his portion. This also is vanity (emptiness, falsity, and futility) and a great evil!

22. For what has a man left from all his labor and from the striving and vexation of his heart in which he has toiled under the sun?

Ecclesiastes 2