Ecclesiastes 2:10–11 (ESV)
10 And whatever my eyes desired I did not keep from them. I kept my heart from no pleasure, for my heart found pleasure in all my toil, and this was my reward for all my toil. 11 Then I considered all that my hands had done and the toil I had expended in doing it, and behold, all was vanity and a striving after wind, and there was nothing to be gained under the sun.
The Vanity of Living Wisely
Ecclesiastes 2:13 (ESV)
13 Then I saw that there is more gain in wisdom than in folly, as there is more gain in light than in darkness.
The Vanity of Toil
Ecclesiastes 2:18–21 (ESV)
18 I hated all my toil in which I toil under the sun, seeing that I must leave it to the man who will come after me, 19 and who knows whether he will be wise or a fool? Yet he will be master of all for which I toiled and used my wisdom under the sun. This also is vanity. 20 So I turned about and gave my heart up to despair over all the toil of my labors under the sun, 21 because sometimes a person who has toiled with wisdom and knowledge and skill must leave everything to be enjoyed by someone who did not toil for it. This also is vanity and a great evil.