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
Most table functions need the CREATE TEMPORARY TABLE privilege to run, so a SELECT or INSERT that executes one is refused when readonly is set to 1.
Last modified on September 4, 2026