Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- o.id,
- ocg.order_id,
- DATE(ot.in_accept) accepted
- FROM orders o
- LEFT JOIN orders_cost_general ocg ON o.id = ocg.order_id
- LEFT JOIN orders_time ot ON o.id = ot.order_id
- LEFT JOIN customers c ON o.customer_id = c.id
- WHERE
- ot.in_accept >= "2017-01-01"
- AND c.id NOT IN (160971, 165890, 45885, 112435)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement