Using IN clause with a subquery

suggest change
SELECT * 
FROM customers 
WHERE id IN (
    SELECT DISTINCT customer_id 
    FROM orders
);

The above will give you all the customers that have orders in the system.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


IN clause:
*Using IN clause with a subquery

Table Of Contents