Show all content with [[fileName#subtitle]]

Task

I linked some texts with [[todo#cat1]] and some with [[todo#cat2]], and want to show them separately, how can I do that?

My todo.md file:

# cat1
…
# cat2
…

Code I have tried:

Table
from [[todo#cat1]]
GROUP BY file.link as DateLink
SORT DateLink DESC

problem

  1. It shows files with link to cat1 AND cat2
  2. It only shows the file link not the text content

You need to read the plugin documentation to understand what’s the plugin do (this seems like a repetitive insistence, but it is the most basic).
Dataview doesn’t work with the full content of the files, it works with metaDATA (data + view).
So, if you want to collect some values, you need to write them in a way that they are parsed as data.

Another thing: [[todo#cat1]] is a link to a section in the file [[todo]]. Use a link in FROM means define as source the files that in-link or out-link that file. For example, if you write FROM [[todo]] you’re defining as source (the files to be queried) pages which link TO “todo” file.