Ecclesiastes 2:21

New International Version Bible (NIV)
For a person may labor with wisdom, knowledge and skill, and then they must leave all they own to another who has not toiled for it. This too is meaningless and a great misfortune.

Read Ecclesiastes 2:21 in other translations