I have a mysql statement as follows
SELECT o.status, COUNT(*) AS COUNT FROM orders o
JOIN branch b ON o.brid=b.br_id AND b.`code`='NY'
WHERE o.created_ON >=DATE_SUB(CURDATE(),INTERVAL 90 DAY)
GROUP BY o.`status`;
This works fine, but now I need to add an or clause to this statement and I am not sure how to do this. The or clause is as follows;
OR o.shop_num IN (SELECT s.shop_no FROM shops s, branches b WHERE
s.branch_id=b.branch_id AND b.branch_code='NY')
If I just embed this nested select statement into the query it takes too long to execute.
Thanks for the help.