You can update existing rows using the
<command>UPDATE</command> command.
Suppose you discover the temperature readings are
all off by 2 degrees after November 28. You can correct the
data as follows:
UPDATEコマンドを使用して、既存の行を更新できます。
11月28日以降の全ての気温の読み取りが2度高くなっていることがわかったとします。
その場合、以下のコマンドによって、データを修正できます。
UPDATE weather
SET temp_hi = temp_hi - 2, temp_lo = temp_lo - 2
WHERE date > '1994-11-28';
Look at the new state of the data: データの更新後の状態を確認します。
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)