Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.49 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SELECT
  2.         t.seller_user_id AS  seller_id,
  3.         us.creation_tsz AS signup_date,
  4.         SUM(t.price*t.quantity) as GMS,
  5.         subpath(t.tags, 0, 1) AS category
  6. FROM
  7.         etsy_v2.transactions t JOIN
  8.         etsy_v2.users_seller us ON t.seller_user_id=us.user_seller_id
  9. WHERE
  10.         EXTRACT(YEAR FROM us.creation_tsz = '2008' AND
  11.         EXTRACT(MONTH FROM us.creation_tsz) = '05' AND
  12.         t.creation_tsz >= '2010-05-01' AND t.creation_tsz < '2010-05-31' AND
  13.         t.tags ~ 'jewelry.*'
  14. GROUP BY 1
  15. ORDER BY GMS DESC, signup_date, category
  16. ;