Using Patterns with Non-String Values : DATE_FORMAT « Date Time « SQL / MySQL






Using Patterns with Non-String Values

      

Function value test                     Pattern match test
YEAR(d) = 1976                          d LIKE '1976-%'
MONTH(d) = 4                            d LIKE '%-04-%'
DAYOFMONTH(d) = 1                       d LIKE '%-01'

   
    
    
    
    
    
  








Related examples in the same category

1.SELECT TIME_FORMAT('02:17', '%H')