programming-examples/sql/Subqueries/11. Write a query to find the name and numbers of all salesmen who had more than one customer.sql

6 lines
148 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
SELECT salesman_id,name
FROM salesman a
WHERE 1 <
(SELECT COUNT(*)
FROM customer
WHERE salesman_id=a.salesman_id);