Untitled

From Toxic Guinea Pig, 3 Months ago, written in Plain Text, viewed 72 times.
URL http://codebin.org/view/4e8c9743 Embed
Download Paste or View Raw
  1. SELECT DISTINCT DATE_TRUNC('month', event_time)::date AS month,
  2.        COUNT(event_id) OVER (partition BY DATE_TRUNC('month', event_time)) AS e_month,
  3.        COUNT(event_id) OVER (order BY DATE_TRUNC('month', event_time))
  4. FROM tools_shop.events
  5. WHERE user_id IN (SELECT user_id FROM tools_shop.events) AND event_name = 'view_item'

Reply to "Untitled"

Here you can reply to the paste above