1 / 5

How To Update a Column Based on Another Column in SQL - Ubiq BI

Here is how to update a column based on another column in SQL Server, MySQL, PostgreSQL.<br>Visit: https://ubiq.co/database-blog/how-to-update-a-column-based-on-another-column-in-sql/

21310
Download Presentation

How To Update a Column Based on Another Column in SQL - Ubiq BI

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How To Update a Column Based on Another Column in SQL

  2. Description Sometimes you may need to update a column in table based on value of another column in table. Here is how to update a column based on another column in SQL Server, MySQL, PostgreSQL.

  3. Characteristics Here are the steps to update a column based on another column in SQL. Let us say you have the following table employees(id, first_name, last_name)

  4. Two Ways To Update Here’s the SQL query to update first_name column based on value of id columns using WHERE clause. In the above statement, the UPDATE statement will first select rows that match the WHERE clause and update value of our column first_name You can also use logical operators like AND/OR in your WHERE clause as shown below.

  5. Thank You Visit: https://ubiq.co/database-blog/how-to-update-a-column-based-on-another-column-in-sql/

More Related