Update

The UPDATE statement is used to change or modify existing database records. The format is as follows:

    UPDATE <table name> SET <colum name>=<new value> WHERE
<filter condition>;

As an example, if there was some sensor error and we found out that the reading we took at 2017-06-18 12:26:08 was actually 16.6, we would have the following:

  • Table name: temperature
  • Column name: value
  • New value: 16.6
  • Filter condition: createdAt = "2017-06-18 12:26:08"

So, our resulting SQL statement would be as follows:

    UPDATE temperature SET value=16.6 WHERE createdAt="2017- 
06-18 12:26:08"
;

The filter condition after the WHERE directive is the same as any filter we may put while reading. If there are multiple records matching the filter, they will all be updated.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.244.201