mysql find the customers for the following case

Questionsmysql find the customers for the following case
sethbeckerman5 Staff asked 10 years ago

I have a table as like bellow:

I need to customers for the following conditions.

a. Who placed order and paid all off them. ie, customer_id: 34, 42, 70

b. Who placed order but not paid any of them. ie, customer_id: 57, 80

c. Who placed order but not paid some of them. ie, customer_id: 45, 62, 65

Note: invoice_no: 0 means order is not paid.

Need suggestions from experts.
Thanks


View on Stack Overflow