##The update statement in the SQL database must be completed using the UPDATE statement. The function of the UPDATE statement is to change the existing data in the database to achieve the purpose of updating the data. In real applications, data changes in the database are inevitable. Typically, most of the data in almost all user databases will be modified to some degree. If you want to modify database records in a SQL Server database, you need to use the UPDATE statement. The UPDATE statement exists to change the existing data in the database. This statement, although it has some complex options, is one of the easiest to learn. This is because in most cases, the high-level part of this statement is rarely used. From the user's perspective, the UPDATE statement is only used to change the data in the specified row. But what actually happens internally is that SQL Server deletes old data rows from the table and inserts new rows.The update statement in the SQL database must be completed using the UPDATE statement. The function of the UPDATE statement is to change the existing data in the database to achieve the purpose of updating the data. Its syntax is "update
set = where...".
UPDATE syntax
update <table_name> set <column_name> = <value> where <search_condition>
Syntax introduction
Example:
Now let’s see how to actually modify a certain row in the table Some lines. We have a column in the table that uses a unique value that distinguishes each row in the table. Therefore, we can easily write an UPDATE statement to change only the row of data corresponding to an author. As follows: The code is as follows:update users set phone=78789831 where number =231;
update shop set priceprice = price * .11 ;
The above is the detailed content of How to write sql update statement. For more information, please follow other related articles on the PHP Chinese website!