This illustrates the problem of taking one verse in the middle of one of the books of the Bible and supposing that it is the author's 'last word' on the subject. Given that there are 12 chapters, and it isn't until the start of chapter 12 that he draws his conclusions, the answer to your question is to go there, to see his 'last word' on the matter of life after physical death.
There is no hermeneutic answer to be found by looking at the one verse you quote. The hermeneutic answer comes when we read the author's own concluding remarks on that subject. As we know, he covers a vast range of subjects about human life "under the sun", when the heavens seem as brass to those who have not 'broken through' (spiritually speaking) to God in heaven. But in his conclusion, he specifically returns to the question of what happens to humans when they die.
He begins by sumarising essential points for young people: to remember their Creator in the days of their youth, before old age and increasing feebleness takes away all joy in living (12:1 onward). He uses illustrations for bodily parts beginning to fail, e.g. 'grinders' being few refer to teeth dropping out, and desire failing. But now comes the really important point:
"Or ever the silver cord be loosed, or the golden bowl be broken, or
the pitcher be broken at the fountain, or the wheel broken at the
cistern, then shall the dust return even to the earth as it was: and
the spirit shall return unto God who gave it." Ecclesiastes 12:6-7
The clincher - showing that the author believes that God (who is in heaven) will judge all who die (which, logically, would happen after they have died) - comes in the last two verses:
"Let us hear the conclusion of the whole matter: Fear God, and keep
his commandments; for this is the whole duty of man. For God shall
bring every work into judgment, with every secret thing, whether it be
good, or whether it be evil." Verses 13-14
Now, is this not clearly speaking of a day of judgment for every person who dies? All their secrets are known to God, who will bring every work of theirs into judgment. The writer clearly speaks of that happening after death because his warning to young people is to remember God before it's too late and death sees their bodies return to dust, and their spirit returns to God, who will hold them accountable for how they lived "under the sun".
The answer to your question, therefore, is that the writer is building up a scene. He is in the middle of that in chapter 6 verse 12, asking an intriguing question to hold his readers' attention- "Who knows if...?"
But he does not leave his readers in suspense. They just have to go on reading another six chapters and then they get the answer. He tells them that, at death, their body becomes dust, while their spirit returns to God who gave it, to judge how they lived in the body, "under the sun".