OK,我會試試看:
1 - 也許你在做rcntrslt
一個錯字,像這樣做,你只列出一次。
UPDATE `database`.holding
SET rcnt_rslts=TRUE
WHERE test_rcnt=TRUE
AND (rcntrslt IN ('pos','neg','indeterminate'));
2- =
也可以區分大小寫,LIKE
從未被嘗試:
UPDATE `database`.holding
SET rcnt_rslts=TRUE
WHERE test_rcnt=TRUE
AND (rcntrslt LIKE 'pos' OR rcntrslt LIKE 'neg' OR rcntrslt LIKE 'indeterminate');
3-可以rcntrslt
還有什麼其他的值,你不能扭轉所有的測試?
UPDATE `database`.holding
SET rcnt_rslts = TRUE
WHERE test_rcnt<>FALSE AND test_rcnt IS NOT NULL
AND (rcntrslt NOT IN ('othervalue','test1','gdsd')
AND rcntrslt IS NOT NULL;
4-也許有在rcntrslt
造成空格或其他非打印字符了一定的污染在那裏。
UPDATE `database`.holding
SET rcnt_rslts=TRUE
WHERE test_rcnt=TRUE
AND (rcntrslt LIKE '%pos%' OR rcntrslt LIKE '%neg%'
OR rcntrslt LIKE '%indeterminate%');
5-如果你想調試,你總是可以在那裏做一些診斷選擇,看看發生了什麼。
CREATE TABLE log (
id integer auto_increment not null primary key,
logtime timestamp,
reason varchar(255) not null,
tablename varchar(255) not null,
fieldnames varchar(10000) not null,
values varchar(10000) not null,
INDEX log_time (logtime),
INDEX log_table (tablename),
INDEX log_reason (tablename, reason)) ENGINE = InnoDB;
INSERT INTO log (reason, tablename, fieldnames, values)
SELECT
'all values','holding', 'test_rcnt,rcntrslt'
, CONCAT(IFNULL(test_rcnt,'NULL'), ',' ,IFNULL(rcntrslt,'NULL')
FROM holding;
INSERT INTO log (reason, tablename, fieldnames, values)
SELECT
'test_rcnt = TRUE','holding', 'test_rcnt,rcntrslt'
, CONCAT(IFNULL(test_rcnt,'NULL'), ',' ,IFNULL(rcntrslt,'NULL')
FROM holding
WHERE test_rcnt = TRUE;
等
現在檢查日誌,看看有什麼是錯的。
@ muistooshort:你好。不,沒有錯誤信息或警告 – jacob