- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What is the use of MySQL NOT LIKE operator?
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.
- Related Articles
- 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?
- Explain the use of sql LIKE operator using MySQL in Python?
- What is the use of RLIKE operator in MySQL?
- Use MySQL LIKE and NOT LIKE to display similar results?
- How can I use 'Not Like' operator in MongoDB?
- What is the significant difference between MySQL LIKE and equal to (=) operator?
- What is the correct syntax for NOT LIKE in MySQL?
- How to use MySQL SOUNDEX() function with LIKE operator to retrieve the records from table?
- What are the different wildcard characters which can be used with NOT LIKE operator?
- What is the use of sizeof Operator in C#?
- What is the use of tilde operator (~) in R?