Select works, but can't update rows with a string of all spaces -- why?
This query
SELECT count(data_id)
FROM cdiac_data_AL
WHERE (data_id >= 1 and data_id <= 30437)
AND (TMIN_flags = '')
returns 844 records, but update query affects 0 records:
UPDATE cdiac_data_AL set TMIN_flags=' '
WHERE (data_id >= 1 and data_id <= 30437)
AND ( TMIN_flags = '' )
What am I missing?
TMIN_flags is:
char(3) ascii_g开发者_开发知识库eneral_ci, allow null, default NULL
It's because the CHAR data type does not save trailing spaces.
You should change TMIN_flags data type to binary
精彩评论