compare_by_nulls.sql 625 B

12345678910111213141516171819
  1. /* syntax version 1 */
  2. /* postgres can not */
  3. use plato;
  4. $src = select null as key, value from Input;
  5. $src_opt = select null as key, Just(value) as value from Input;
  6. $src_null = select null as key, null as value from Input;
  7. select min_by(value, key) from $src;
  8. select max_by(value, key) from $src_opt;
  9. select min_by(value, key) from $src_null;
  10. select max_by(value, key) from (select * from $src limit 0);
  11. select min_by(value, key) from (select * from $src_opt limit 0);
  12. select max_by(value, key) from (select * from $src_null limit 0);
  13. select min_by(value, key) from (select Nothing(String?) as key, value from Input);