如何查询 a 中的最大值varray
?
create type myWave as varray(10) of int;
create table foo (id number, yVals myWave);
insert into foo values (1, myWave(1, 8, 5));
insert into foo values (2, myWave(1, 3, 4));
insert into foo values (3, myWave(9, 5, 9));
insert into foo values (4, myWave(8, 2));
错误的 SQL:SELECT id, MAX(yVals) maxY FROM foo
期望的输出:
| id | maxY |
|----|------|
| 1 | 8 |
| 2 | 4 |
| 3 | 9 |
| 4 | 8 |