Mega Code Archive

 
Categories / MySQL Tutorial / Control Flow Functions
 

Using IF with float point value

mysql> mysql> SELECT IF(0.1,1,0); +-------------+ | IF(0.1,1,0) | +-------------+ |           1 | +-------------+ 1 row in set (0.00 sec) mysql> mysql> SELECT IF(0.1<>0,1,0); +----------------+ | IF(0.1<>0,1,0) | +----------------+ |              1 | +----------------+ 1 row in set (0.00 sec) mysql>