QUERY
Runs SQL-like query on data range.
- Excel: No equivalent
- Google Sheets: Not checked yet
- Returns: Array
Examples
=QUERY(R1:S4, "select A, B where B > 150") | R | S | |
|---|---|---|
| 1 | region | amount |
| 2 | north | 100 |
| 3 | south | 200 |
| 4 | north | 300 |
Result south
=QUERY(R1:S4, "select A, B order by B desc limit 2") Result, over the same cells region
Syntax
QUERY(data, query, [headers]) data- range required
query- text required
headers- number optional
Related
DECODEURLDecodes URL-encoded text. ENCODEURLEncodes text for use in URLs using percent encoding. FILTERXMLSelects values from an xml STRING with an xpath. IMPORTRANGEImports a range from another deepcalc workbook, addressed as {namespace}/{name}: e.g. worldbank/gdp. Resolution is journaled, never live-silent: refreshing the workbook's Sources materializes the target values as ordinary ops, so every upstream change arrives as a reviewable diff. Each source can track the latest version or be pinned to a specific one (the Sources panel). Before the first refresh the cell shows #NAME?. The inline form ={ns}/{name}!worksheet!A1:B10 is equivalent.