Advertisements
Advertisements
Question
Ms. Ravina is using a table 'customer' with custno, name, address and phonenumber. She needs to display name of the customers, whose name start with letter 'S'. She wrote the following command, which did not give the result.
Select * from customer where name="S%";
Help Ms. Ravina to run the query by removing the errors and write the correct query.
Very Short Answer
Advertisements
Solution
The LIKE operator must be used instead of = for pattern matching. The % wildcard represents zero or more characters.
SELECT *
FROM customer
WHERE name LIKE 'S%';
shaalaa.com
Is there an error in this question or solution?
