lambda_duplicate_arg.sqlx 338 B

12345678910111213
  1. /* postgres can not */
  2. USE plato;
  3. $shiftSteps=1;
  4. $linear = ($x, $z, $x)->{ -- $x is duplicated
  5. $v = 10 * $z + $x;
  6. $shift = ($item) -> {return $item << $shiftSteps};
  7. $res = Math::Floor(Math::Pi() * $shift($v));
  8. return $res
  9. };
  10. --INSERT INTO Output
  11. SELECT t.*, $linear(cast(key as uint64), cast(subkey as uint64)) FROM Input as t;