programming-examples/sql/Joins/Write a SQL statement to make a list in ascending order for the customer who holds a grade less than 300 and works either through a salesman or by own.sql
2019-11-18 14:05:53 +01:00

9 lines
362 B
SQL

/*Write a SQL statement to make a list in ascending order for the customer who holds a grade less than 300 and 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 OUTER JOIN salesman b
ON a.salesman_id=b.salesman_id
WHERE a.grade<300
ORDER BY a.customer_id;