Ecclesiastes 2:26

God has given, to the man who is good in his sight, wisdom, and knowledge, and rejoicing. But to the sinner, he has given affliction and needless worrying, so as to add, and to gather, and to deliver, to him who has pleased God. But this, too, is emptiness and a hollow worrying of the mind

Other versions

King James Version

For God giveth to a man that is good in his sight wisdom, and knowledge, and joy: but to the sinner he giveth travail, to gather and to heap up, that he may give to him that is good before God. This also is

English Standard Version

For to the one who pleases him God has given wisdom and knowledge and joy, but to the sinner he has given the business of gathering and collecting, only to give to one who pleases God. This also is vanity and a striving after wind.

New International Version

To the man who pleases him, God gives wisdom, knowledge and happiness, but to the sinner he gives the task of gathering and storing up wealth to hand it over to the one who pleases God. This too is meaningless, a chasing after the wind.