To invert a pattern match, use NOT LIKE rather than LIKE: : Like « Select Clause « SQL / MySQL






To invert a pattern match, use NOT LIKE rather than LIKE:

       
mysql>
mysql> SELECT 'ABC' LIKE 'A%', 'ABC' NOT LIKE 'A%';
+-----------------+---------------------+
| 'ABC' LIKE 'A%' | 'ABC' NOT LIKE 'A%' |
+-----------------+---------------------+
|               1 |                   0 |
+-----------------+---------------------+
1 row in set (0.00 sec)

mysql>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Use LIKE
2.Use LIKE for matching substring
3.Pattern match with LIKE
4.Where clause: like and %
5.Where clause: regular expressions
6.Where clause: regular expression 2
7.Use LIKE in where clause
8.SELECT 'AA' LIKE 'A%', 'AA' LIKE 'A\%', 'A%' LIKE 'A\%';
9.Pattern Matching with LIKE
10.Using LIKE with SQL Pattern Matches