a guest Sep 24th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. INSERT INTO some_cube_analytics(count, filter1, filter2, filter3, filter4, filter5, filter6)
  2.     SELECT
  3.       count(*) as count,
  4.       filter1,
  5.       filter2,
  6.       filter3,
  7.       filter4,
  8.       filter5,
  9.       filter6
  10.     FROM some_table
  11.     GROUP BY
  12.         ROLLUP(filter1, filter2),
  13.         CUBE(filter3, filter4, filter5, filter6)
  14.   ON CONFLICT ON CONSTRAINT some_cube_analytics_pk DO NOTHING;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand