programming-examples/sql/Joins/Write a SQL statement to make a list in ascending order for the customer who works either through a salesman or by own.sql

7 lines
299 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*Write a SQL statement to make a list in ascending order for the customer who works either through a salesman or by own.*/
SELECT a.cust_name,a.city,a.grade,
b.name AS "Salesman",b.city
FROM customer a
LEFT JOIN salesman b
ON a.salesman_id=b.salesman_id
order by a.customer_id;