Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.21 KB | None | 0 0
  1. SELECT
  2.     sd.user_id,
  3.     COUNT(DISTINCT ol.order_id)
  4. FROM shop_details AS sd
  5. JOIN order_list AS ol ON ol.shop_id = sd.shop_id
  6. WHERE
  7.     -- to have info in order_history table
  8.     ol.order_create_time >= '2019-01-01'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement