Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- sd.user_id,
- COUNT(DISTINCT ol.order_id)
- FROM shop_details AS sd
- JOIN order_list AS ol ON ol.shop_id = sd.shop_id
- WHERE
- -- to have info in order_history table
- ol.order_create_time >= '2019-01-01'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement