Skip to content

Showcase basic syntax of TABLE queries

Basic Table Queries

Basic

Show pages from a folder as table

TABLE
FROM "10 Example Data/games"

Show pages from a tag as table

TABLE
FROM #type/books 

Combine multiple tags

TABLE
FROM #dvjs/el OR #dv/min 

Combine multiple folders

TABLE
FROM "10 Example Data/books" OR "10 Example Data/games"

Combine tags and folders

TABLE
FROM "10 Example Data/games" AND #genre/action  

List all pages

Add dataview to code block

The output of this is pretty long. If you want to see it, add dataview to the code block - like on the examples above!
Please note: There needs to be a space behind TABLE to see results!

TABLE 

Variants

Show pages from a certain author

TABLE
FROM #type/books 
WHERE author = "Conrad C"

Show pages and additional information

TABLE author, pagesRead, totalPages
FROM #type/books
TABLE WITHOUT ID source, time, ingredients
FROM "10 Example Data/food"
WHERE source

Group list elements

What is#^new-id-after-grouping

Without additional columns

TABLE 
FROM "10 Example Data/books"
GROUP BY author

With additional columns

TABLE rows.file.link, rows.pagesRead
FROM "10 Example Data/books"
GROUP BY author

Customize table headers

Of additional columns

TABLE contacts.phone AS "Phone Number", contacts.mail AS "E-Mail"
from "10 Example Data/people"

Of the first (link/group) header without grouping

TABLE WITHOUT ID file.link AS "Game", developer, price
FROM "10 Example Data/games"

Of the first (link/group) header with grouping

TABLE WITHOUT ID key AS "Author", rows.file.link AS "Books"
FROM "10 Example Data/books"
GROUP BY author

Sort tables

TABLE author
FROM "10 Example Data/books"
SORT author

Advanced usage

Do you want to see more advanced examples? Head over to the Query Type Overview to see all available TABLE queries in the vault!