Database - Introduction to SQL - Discussion
Discussion Forum : Introduction to SQL - General Questions (Q.No. 5)
5.
The wildcard in a WHERE clause is useful when?
Discussion:
16 comments Page 2 of 2.
Jaba said:
2 decades ago
Wildcard chars are used to replace any substring.for eg if you want to write a query to get the names which starts with s, we can write it as select * from employee where name LIKE "s%" and - replace single character.
Khushboo jain said:
1 decade ago
Please give the answer in more detail.
Sirisha said:
1 decade ago
What is meant by wildcard can you explain clearly?
Kitty said:
1 decade ago
Can you explain with some more details?
Kirti said:
1 decade ago
Can you explain why Wildcard chars are used to replace any substring?
ARUN said:
1 decade ago
SQL wildcard('%') to find the entire search value or substring of the search value.It is like a grep command, which displays all results which matches that pattern.
For example if you have table student and want to display the student name ends with 'n' then the query will be:
SELECT * FROM STUDENT WHERE name LIKE '%n';
If you want to search name that have 'n' any where in the name:
SELECT * FROM STUDENT WHERE name LIKE '%n%';
For example if you have table student and want to display the student name ends with 'n' then the query will be:
SELECT * FROM STUDENT WHERE name LIKE '%n';
If you want to search name that have 'n' any where in the name:
SELECT * FROM STUDENT WHERE name LIKE '%n%';
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers