NOT LIKE in MYSQL by R4R Team

MYSQL NOT LIKE condition:
Basically,NOT LIKE condition are just opposite of the LIKE Operator.
-NOT LIKE is used with select,insert,delete command.

Syntax:
WHERE expression NOT LIKE pattern;

Display all record of table employee:

SELECT * FROM employee;

emp_id emp_name department emp_salary
1 Aman D1 34000
2 Ram D2 43000
3 Ramesh D1 20000
4 John D3 65000
5 Sita D1 10000
6 Dinesh D2 15000


Now we display the employee record whose name not start with 'Ra'

SELECT * FROM employee WHERE emp_name NOT LIKE 'Ra%';

emp_id emp_name department emp_salary
1 Aman D1 34000
4 John D3 65000
5 Sita D1 10000
6 Dinesh D2 15000




Leave a Comment: