An underscore (_) matches only one character exactly : Underscore « Regular Expression « SQL / MySQL






An underscore (_) matches only one character exactly

      
mysql>
mysql> SELECT 'abcd' LIKE 'a_ _ _';
+----------------------+
| 'abcd' LIKE 'a_ _ _' |
+----------------------+
|                    0 |
+----------------------+
1 row in set (0.00 sec)

mysql>
mysql> SELECT 'abcd' LIKE 'a_ _';
+--------------------+
| 'abcd' LIKE 'a_ _' |
+--------------------+
|                  0 |
+--------------------+
1 row in set (0.00 sec)

mysql>

   
    
    
    
    
    
  








Related examples in the same category