Ecclesiastes 2:19

19 And who knoweth whether he is wise or foolish? yet he doth rule over all my labour that I have laboured at, and that I have done wisely under the sun! this also [is] vanity.

Ecclesiastes 2:19 In-Context

17 And I have hated life, for sad to me [is] the work that hath been done under the sun, for the whole [is] vanity and vexation of spirit.
18 And I have hated all my labour that I labour at under the sun, because I leave it to a man who is after me.
19 And who knoweth whether he is wise or foolish? yet he doth rule over all my labour that I have laboured at, and that I have done wisely under the sun! this also [is] vanity.
20 And I turned round to cause my heart to despair concerning all the labour that I laboured at under the sun.
21 For there is a man whose labour [is] in wisdom, and in knowledge, and in equity, and to a man who hath not laboured therein he giveth it -- his portion! Even this [is] vanity and a great evil.
Young's Literal Translation is in the public domain.