MySQL - Select if value is numeric

This is how you can determine if a value is numeric or not, and depending on that do different with the value, for instance use ROUND() on numeric value or show a text string as it is.

In this case I want to use the function ROUND() on numeroic values but show plain text as is on all other values.

<?php
SELECT 
IF(CAST( price.sPriceSec AS UNSIGNED) = 0, price.sPriceSec, ROUND(price.sPriceSec) ) as price,
....
?>
Knowledge keywords: