Answers for "sql set values"

SQL
10

sql update from select

UPDATE YourTable 
SET Col1 = OtherTable.Col1, 
    Col2 = OtherTable.Col2 
FROM (
    SELECT ID, Col1, Col2 
    FROM other_table) AS OtherTable
WHERE 
    OtherTable.ID = YourTable.ID
Posted by: Guest on April-02-2020
1

sql set

Used alongside UPDATE to update existing data in a table.
Example: Updates the value and quantity values for an order with an id of
642 in the orders table.
UPDATE orders
SET value = 19.49, quantity = 2
WHERE id = 642;
Posted by: Guest on January-07-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language