Guest User

Untitled

a guest
Jul 19th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. SELECT
  2. # Change the interval based on UTC to show on specific timezone
  3. date_format(date_sub(o.created_at, INTERVAL 7 HOUR), "%l:%i %p") `Time in PST`,
  4. count(*) OPM
  5. FROM sales_flat_order o
  6. # Time from the DB - last 3 hours
  7. WHERE o.created_at > DATE_SUB(NOW(), INTERVAL 3 HOUR)
  8. AND o.created_at < NOW()
  9. AND o.store_id='1374'
  10. GROUP BY HOUR(o.created_at),MINUTE(o.created_at)
  11. ORDER BY o.created_at ASC;
Add Comment
Please, Sign In to add comment