A SELECT statement retrieves rows or expressions from one or more data sources. It can filter, deduplicate, transform, and feed results directly into another SQL operation, making it a practical link between files, tables, and data pipelines. section 3.4.1 section 3.4
Common workflow uses include:
- Filter stored readings with WHERE and expressions such as date_trunc. section 3.4.1
- Select distinct columns from a CSV relation before inserting them into a table. section 3.4.1
- Transform source values with CASE while loading remote CSV data. section 3.4.1
Inspect one day of readings
SELECT * FROM readings WHERE date_trunc('day', read_on) = '2019-08-26' AND power <> 0; This query returns the nonzero readings for one day, including timestamps and power values. section 3.4.1
SELECT *
FROM (
SELECT 'https://' || years.range || '.csv' AS v
FROM range(2019,2021) years
) urls, read_csv_auto(urls.v);
Builds a SELECT-derived URL relation and passes it to read_csv_auto, demonstrating how queries can connect generated values with file ingestion. section 3.4.1








