How to Update a Select Statement
- 1). Open your database application. You can use either a command line interface or the graphical user interface provided by your database vendor.
- 2). Connect to your database.
- 3). Create the update query by typing the "UPDATE" keyword followed by the table name to update. It should say "UPDATE MyTable."
- 4). Type the keyword "SET" followed by the column name that the data will be changed in and an equal sign.
- 5). Type the new value for the column. Character data uses single quote marks around the value. Numeric data does not require quotes. You can update multiple columns by repeating the column equals value pattern, separated by commas. For example, "SET Column1=44, Column2='new value'" is a proper value column.
- 6). Add a "WHERE" clause to limit updates to only specific records, if desired.
- 7). Execute the SQL statement.