0
我可以檢查更新值是否爲N
,然後跳過此字段?如果更新值是特定字符串,跳過以更新表格字段
是否應該在PHP或MySQL的代碼中完成?
的流動是:
BEFORE
update store set book1 = 'Y', book2 = 'Y', book3 = 'N', book4 = 'N', book5 = 'N' where id =
1;
AFTER
update store set book1 = 'Y', book2 = 'Y' where id =
1;
因爲BOOK3,book4和Book5兩個將被更新爲N
的價值,所以我跳過這個字段