[MySQL] How to check if a value is a number
Here it is a function for checking if a field value represent a number. Floating point and negative numbers are also considered.
CREATE FUNCTION IsNumeric (sIn varchar(1024)) RETURNS tinyint
RETURN sIn REGEXP '^(-|\\+){0,1}([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+|[0-9]+)$';
Via: Stack Overflow.