cid | orderid | status (shipped,declined/approved)
1 | 101 | approved
1 | 102 | approved
I want to be able to show only duplicate orders that were approved
In my db table, if I use this query:
Code: Select all
SELECT * FROM orders GROUP BY (customers_id) HAVING count(customers_id)>1status updates, from shipped, approved/etc. I only want approved. So I tried this:
Code: Select all
SELECT * FROM orders GROUP BY (customers_id) HAVING count(customers_id)>1 AND STATUS='shipped'I only want records that are multiple orders from the same person while *also* only being 'approved' status. How do I go about
completing the query so only orders that are 'approved' display among the customers that ordered more than 1 product?
Thanks