- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the use of MySQL NOT LIKE operator?
152 Lectures 16 hours
87 Lectures 5.5 hours
With the help of MySQL NOT LIKE operator, we can check non-presence of a string of specified pattern within another string. Its syntax is NOT LIKE specific_pattern.
Specific_pattern is the pattern of string we do not want to find out within another string.
Suppose we have a table named ‘student_info’ having names of the students and we want to get the details of all those students which are not having pattern of string ‘Ga’ within their names. It can be done with the help of following MySQL query −
mysql> Select * from Student_info WHERE name NOT LIKE '%Ga%'; +------+---------+----------+-----------+ | id | Name | Address | Subject | +------+---------+----------+-----------+ | 101 | YashPal | Amritsar | History | | 125 | Raman | Shimla | Computers | +------+---------+----------+-----------+ 2 rows in set (0.05 sec)
In the above example, the ‘%’ symbol is a wildcard used along with NOT LIKE operator.
- What is the use of MySQL SOUNDS LIKE operator?
- What is the use of SOUNDS LIKE operator in MySQL?
- What is the use of MySQL IS and IS NOT operator?
- What is the use of EXIST and EXIST NOT operator with MySQL subqueries?
- What is the use of RLIKE operator in MySQL?
- Explain the use of sql LIKE operator using MySQL in Python?
- Use MySQL LIKE and NOT LIKE to display similar results?
- What is the correct syntax for NOT LIKE in MySQL?
- How can I use 'Not Like' operator in MongoDB?
- What is the significant difference between MySQL LIKE and equal to (=) operator?
- What is the use of sizeof Operator in C#?
- What is the use of tilde operator (~) in R?