Skip to main content
Table functions are methods for constructing tables.

Usage

Table functions can be used in the FROM clause of a SELECT query. For example, you can SELECT data from a file on your local machine using the file table function.
Query
Response
You can also use table functions for creating a temporary table that is available only in the current query. For example:
Query
Response
The table is deleted when the query finishes. Table functions can be used as a way to create tables, using the following syntax:
Query
For example:
Query
Response
Finally, table functions can be used to INSERT data into a table. For example, we could write out the contents of the table we created in the previous example to a file on disk using the file table function again:
Query
Query
You can’t use table functions if the allow_ddl setting is disabled.
Last modified on July 2, 2026