group_by_gs_flatten.sql 269 B

123456789101112
  1. /* syntax version 1 */
  2. /* postgres can not */
  3. use plato;
  4. $input = select a.*, [1,2] as lst from Input as a;
  5. select key, subkey, some(lst) as lst_count
  6. from $input flatten list by lst
  7. where lst != 1
  8. group by grouping sets ((key), (key, subkey))
  9. order by key, subkey;