programming-examples/sql/Subqueries/21. Write a query to display the salesmen which name are alphabetically lower than the name of the customers.sql

7 lines
235 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*21. Write a query to display the salesmen which name are alphabetically lower than the name of the customers.*/
SELECT *
FROM salesman a
WHERE EXISTS
(SELECT *
FROM CUSTOMER b
WHERE a.name < b.cust_name);