The UPDATE statement

The UPDATE statement is used to change the data in the records of a table without changing their number. It has the following syntax:

UPDATE <table_name>
SET <field_name> = <expression>[, ...]
[FROM <table_name> [JOIN clause]]
[WHERE <condition>];

There are two ways of using the UPDATE statement. The first is similar to the simple SELECT statement and is called sub-select. The second is based on other tables and is similar to the SELECT statement from multiple tables. In most cases, the same result can be achieved using any of these methods.
In PostgreSQL, only one table can be updated at a time. Other databases may allow the updating of multiple tables at the same time under certain conditions.

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

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