win_peephole_double_usage.sql 248 B

1234567891011121314
  1. /* syntax version 1 */
  2. /* postgres can not */
  3. $input = select * from as_table([<|key:1|>, <|key:1|>]);
  4. $src = select
  5. key,
  6. MIN(key) over w as curr_min
  7. from $input
  8. window w as (order by key);
  9. select * from $src
  10. union all
  11. select * from $src;