Mega Code Archive

 
Categories / MySQL / String
 

The following comparison produces a result that is correct in lexical terms but incorrect in temporal terms

mysql> mysql> mysql> SELECT RIGHT('1987-7-1',5) < RIGHT('1987-10-01',5); +---------------------------------------------+ | RIGHT('1987-7-1',5) < RIGHT('1987-10-01',5) | +---------------------------------------------+ |                                           0 | +---------------------------------------------+ 1 row in set (0.00 sec) mysql>