create table t1 (a int);
insert into t1 values (1),(2);
select max('foo') from t1 group by value(a), extractvalue('bar','qux') order by "v";
max('foo')
foo
drop table t1;