UPDATE people
SET name ='numeric'
WHERE ISNUMERIC (name) =1;
Trying to set all names in name column which are numeric values to 'numeric'.
UPDATE people
SET name ='numeric'
WHERE ISNUMERIC (name) =1;
Trying to set all names in name column which are numeric values to 'numeric'.
ISNUMERIC()
is a function in SQL Server. I don't even recommend using the function in that database -- the TRY_CAST()
and TRY_CONVERT()
are more accurate.
In MySQL, you can use regular expressions. It is unclear what you mean by "isnumeric" in this context, but:
UPDATE people
SET name = 'numeric'
WHERE name REGEXP '^[0-9]+[.]?[0-9]*$';
This gets any things with a string of digits, at most one decimal point, and at least one digit before the decimal point. It is easy to modify for negative numbers and exponential notation if that is really what you intend.
If by "numeric" you just mean a string of digits, then:
UPDATE people
SET name = 'numeric'
WHERE name REGEXP '^[0-9]+$';
You should probably be using the HAVING clause, here. The HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions.
UPDATE people
SET name ='numeric'
HAVING ISNUMERIC (name) =1;