Ecclesiastes 2:18 Midrash

וְשָׂנֵ֤אתִֽי אֲנִי֙ אֶת־כָּל־עֲמָלִ֔י שֶׁאֲנִ֥י עָמֵ֖ל תַּ֣חַת הַשָּׁ֑מֶשׁ שֶׁ֣אַנִּיחֶ֔נּוּ לָאָדָ֖ם שֶׁיִּהְיֶ֥ה אַחֲרָֽי׃

And I hated all my labour wherein I laboured under the sun, seeing that I must leave it unto the man that shall be after me.

Read midrashic interpretation of Ecclesiastes 2:18: and classical rabbinic exegesis.