SQL: Sort records using in operator
SQL Wildcard & Special Operator : Exercise-4 with Solution
Write a query to sort out those customers with all information whose ID value is within any of 3007, 3008 and 3009.
Sample table: customer
SELECT * FROM customer WHERE customer_id IN (3007,3008,3009);
Output of the Query:
customer_id cust_name city grade salesman_id 3007 Brad Davis New York 200 5001 3008 Julian Green London 300 5002 3009 Geoff Cameron Berlin 100 5003
Pictorial presentation :
Contribute your code and comments through Disqus.
Previous: Write a query to produce a list of salesman_id, name, city and commision of each salesman who live in cities other than Paris and Rome.
Next: Write a SQL statement to find those salesmen with all information who get the commission within a range of 0.12 and 0.14.
What is the difficulty level of this exercise?