From Sludgy Leopard, 2 Months ago, written in Plain Text, viewed 58 times.
URL http://codebin.org/view/40f3f2c2 Embed
Download Paste or View Raw
  1. table_1 as (SELECT CAST(DATE_TRUNC('month', event_time) as date) as month,
  2.        COUNT(event_id) as events
  3. FROM tools_shop.events
  4. WHERE event_name LIKE 'view_item'
  5. GROUP BY month)
  7. SELECT month,
  8.        events,
  9.        SUM(events) OVER (ORDER BY month)
  10. FROM table_1

Reply to "Untitled"

Here you can reply to the paste above