Set WeberTrivia.com to be my default homepage.   Suggest a Question                                               

Suggest A Question : :  Frequently Asked Questions : :  Search : :  Relevant Manuals : : 
PHP Questions : :  Linux Questions : :  MySQL Questions : : 
home  [ Login ] 

2.8. Updates

You can update existing rows using the UPDATE command. Suppose you discover the temperature readings are all off by 2 degrees as of November 28. You may update 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)

Who's Online
Guest Users: 14
Google
Web
WeberTrivia
WeberDev
WeberForums
 Free Sample Chapters  Free Sample Chapters
  Deliver First Class Web Sites: 101 Essential Checklists
Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?

More Sample Chapters

PHP General