kosiew commented on issue #16366:
URL: https://github.com/apache/datafusion/issues/16366#issuecomment-2968970691
```sql
DataFusion CLI v48.0.0
> -- Define sample data
CREATE TABLE t1 (a INT, b INT, c INT) AS VALUES
(4, NULL, NULL),
(1, 2, 3),
(3, 1, 2),
(1, NULL, -1),
(NULL, NULL, NULL),
(3, 0, -1);
-- Display per-row minima and maxima
SELECT a, b, c,
least(a, b, c) AS row_min,
greatest(a, b, c) AS row_max
FROM t1;
-- A few scalar examples
SELECT greatest(4, 7, 5) AS g1, least(4, 7, 5) AS l1;
SELECT greatest(-1, 10, 3), least(-1, 10, 3);
0 row(s) fetched.
Elapsed 0.036 seconds.
+------+------+------+---------+---------+
| a | b | c | row_min | row_max |
+------+------+------+---------+---------+
| 4 | NULL | NULL | 4 | 4 |
| 1 | 2 | 3 | 1 | 3 |
| 3 | 1 | 2 | 1 | 3 |
| 1 | NULL | -1 | -1 | 1 |
| NULL | NULL | NULL | NULL | NULL |
| 3 | 0 | -1 | -1 | 3 |
+------+------+------+---------+---------+
6 row(s) fetched.
Elapsed 0.008 seconds.
+----+----+
| g1 | l1 |
+----+----+
| 7 | 4 |
+----+----+
1 row(s) fetched.
Elapsed 0.002 seconds.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]