Advertisements
Advertisements
Question
Sonal needs to display name of teachers, who have "o" as the third character in their name. She wrote the following query.
Select name
From teacher
Where name ="$$o?";
But the query is not producing the result. Identify the problems.
Very Short Answer
Advertisements
Solution
Problems:
=cannot perform pattern matching; useLIKE.- SQL wildcards are
%and_, not$$and?. - For
oas the third character, use two underscores beforeo, followed by%.
SELECT name
FROM teacher
WHERE name LIKE '__o%';
shaalaa.com
Is there an error in this question or solution?
