From 5e45211a64149b3c659b90ff2de6fa982a5a93ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:17:33 +0200 Subject: Adding upstream version 15.5. Signed-off-by: Daniel Baumann --- doc/src/sgml/html/tutorial-update.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 doc/src/sgml/html/tutorial-update.html (limited to 'doc/src/sgml/html/tutorial-update.html') diff --git a/doc/src/sgml/html/tutorial-update.html b/doc/src/sgml/html/tutorial-update.html new file mode 100644 index 0000000..d5879a2 --- /dev/null +++ b/doc/src/sgml/html/tutorial-update.html @@ -0,0 +1,26 @@ + +2.8. Updates

2.8. Updates

+ You can update existing rows using the + UPDATE command. + Suppose you discover the temperature readings are + all off by 2 degrees after November 28. You can correct the + data as follows: + +

+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)
+

+

\ No newline at end of file -- cgit v1.2.3