?
This document uses PHP Chinese website manual Release
你可以用UPDATE命令更新現(xiàn)有的行。 假設(shè)你發(fā)現(xiàn)所有11月28日的溫度計(jì)數(shù)都低了兩度,那么你就可以用下面的方式更新數(shù)據(jù):
UPDATE weather SET temp_hi = temp_hi - 2, temp_lo = temp_lo - 2 WHERE date > '1994-11-28';
看看數(shù)據(jù)的新狀態(tài):
SELECT * FROM weather; city | temp_lo | temp_hi | prcp | date ---------------+---------+---------+------+------------ San Francisco | 46 | 50 | 0.25 | 1994-11-27 San Francisco | 41 | 55 | 0 | 1994-11-29 Hayward | 35 | 52 | | 1994-11-29 (3 rows)