Ecclesiastes 2:19-22 New American Standard Bible (NASB)

19. And who knows whether he will be a wise man or a fool? Yet he will have control over all the fruit of my labor for which I have labored by acting wisely under the sun. This too is vanity.

20. Therefore I completely despaired of all the fruit of my labor for which I had labored under the sun.

21. When there is a man who has labored with wisdom, knowledge and skill, then he gives his legacy to one who has not labored with them. This too is vanity and a great evil.

22. For what does a man get in all his labor and in his striving with which he labors under the sun?

Ecclesiastes 2