SUBSTRING(, , ) : SUBSTRING « String « SQL / MySQL






SUBSTRING(, , )

     
mysql>
mysql> SELECT SUBSTRING('cats and dogs and more dogs', 10, 4);
+-------------------------------------------------+
| SUBSTRING('cats and dogs and more dogs', 10, 4) |
+-------------------------------------------------+
| dogs                                            |
+-------------------------------------------------+
1 row in set (0.00 sec)

mysql>

   
    
    
    
    
  








Related examples in the same category

1.SUBSTRING(, )
2.Sorting by Variable-Length Substrings
3.Create Initial name with substr function
4.In some cases, pattern matches are equivalent to substring comparisons.
5.SUBSTRING( ) function takes a string and a starting position, returning everything to the right of the positio
6.Substrings can be used to perform comparisons.
7.Sort using combinations of substrings
8.Get 3-letter substrings from the dept column
9.Get the numeric middle part by beginning with the ID, then stripping off the rightmost suffix