I\'m getting an odd \'Truncated incorrect INTEGER value\' error when I run the following UPDATE query:
update tbl
set projectNumber = right(comments, 7)
wher
It's not an error. It's a warning that comes from CONVERT() when you ask it to convert non-numeric to integer;
Run these queries in console to see:
mysql> SELECT CONVERT(right('1s23d45678', 7), SIGNED INTEGER);
+-------------------------------------------------+
| CONVERT(right('1s23d45678', 7), SIGNED INTEGER) |
+-------------------------------------------------+
| 3 |
+-------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> SHOW WARNINGS;
+---------+------+----------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: '3d45678' |
+---------+------+----------------------------------------------+
1 row in set (0.00 sec)
As I said, it's a warning, not an error. Your query should be doing the update correctly.