SQL
`COLUMNS` Expression
The `COLUMNS` expression can be used to execute the same expression on the values in multiple columns. For example:  
```sql
CREATE TABLE numbers (id INTEGER, number INTEGER);
INSERT INTO numbers VALUES (1, 10), (2, 20), (3, NULL);
SELECT min(COLUMNS(*)), count(COLUMNS(*)) FROM numbers;
```  
<div class="narrow_table"></div>  
| id | number | id | number |
|---:|-------:|---:|-------:|
| 1  | 10     | 3  | 2      |  
The `*` expression in the `COLUMNS` statement can also contain `EXCLUDE` or `REPLACE`, similar to regular star expressions.  
```sql
SELECT
min(COLUMNS(* REPLACE (number + id AS number))),
count(COLUMNS(* EXCLUDE (number)))
FROM numbers;
```  
<div class="narrow_table"></div>  
| id | min(number := (number + id)) | id |
|---:|-----------------------------:|---:|
| 1  | 11                           | 3  |  
`COLUMNS` expressions can also be combined, as long as the `COLUMNS` contains the same (star) expression:  
```sql
SELECT COLUMNS(*) + COLUMNS(*) FROM numbers;
```  
<div class="narrow_table"></div>  
| id | number |
|---:|-------:|
| 2  | 20     |
| 4  | 40     |
| 6  | NULL   |  
`COLUMNS` expressions can also be used in `WHERE` clauses. The conditions are applied to all columns and are combined using the logical `AND` operator.  
```sql
SELECT *
FROM (
SELECT 0 AS x, 1 AS y, 2 AS z
UNION ALL
SELECT 1 AS x, 2 AS y, 3 AS z
UNION ALL
SELECT 2 AS x, 3 AS y, 4 AS z
)
WHERE COLUMNS(*) > 1; -- equivalent to: x > 1 AND y > 1 AND z > 1
```  
<div class="narrow_table"></div>  
| x | y | z |
|--:|--:|--:|
| 2 | 3 | 4 |