The wildcard in a WHERE clause is useful when?
By BYJU'S Exam Prep
Updated on: September 25th, 2023
The wildcard in a WHERE clause is useful when?
- An exact match is necessary for a SELECT statement.
- An exact match is not possible in a SELECT statement.
- An exact match is necessary for a CREAT statement.
- An exact match is not possible in a CREATE statement.
Answer: Option B. An exact match is not possible in a SELECT statement.
Table of content
The wildcard in a WHERE clause is useful when an exact match is not possible in a SELECT statement.
Solution:
The wildcard in a WHERE clause is useful when an exact match is not possible in a SELECT statement. Suppose you want to find all the names starting with “An” then in this case SELECT clause is not sufficient alone. With the help of a wildcard, we can retrieve our desired output.
Example: Find the names of employees from table Emp where fname starts with An?
Answer: The query will be :
SELECT *
FROM Emp
WHERE fname LIKE ‘An%’;
☛ Related Questions: