xxxxxxxxxx
UPDATE STATGLOB1
SET RESILI = tttt.nnn
(Select Count(ABONNE.NUMAB) as nnn From (ABONNE
Inner Join ABONMENT ON ABONMENT.NUMAB = ABONNE.NUMAB)
Where ABONNE.SECTEUR='01'
And ABONMENT.ETATCPT=+QuotedStr('40')
Group By ABONNE.SECTEUR,Left(ABONNE.NUMAB,2),ABONNE.TYPABON,ABONMENT.ETATCPT) as tttt
xxxxxxxxxx
UPDATE YourTable
SET Col1 = OtherTable.Col1,
Col2 = OtherTable.Col2
FROM (
SELECT ID, Col1, Col2
FROM other_table) AS OtherTable
WHERE
OtherTable.ID = YourTable.ID
xxxxxxxxxx
UPDATE your_table_name
SET column1 = select_statement.column1,
column2 = select_statement.column2
FROM (
SELECT column1, column2
FROM another_table
-- Optional: Add JOIN or WHERE conditions to filter/select specific records
) AS select_statement
WHERE your_table_name.id = select_statement.id;
xxxxxxxxxx
/* modify data in a database table */
UPDATE Customers SET City = 'New York' WHERE CustomerID = 1;
xxxxxxxxxx
UPDATE `table_name` SET `column1` = value1, `column2` = value2 WHERE condition;
xxxxxxxxxx
UPDATE your_table
SET column1 = new_value1,
column2 = new_value2,
FROM (
SELECT column_to_update, value
FROM another_table
WHERE some_condition
) AS subquery
WHERE your_table.join_column = subquery.join_column;
xxxxxxxxxx
--the simplest way of doing this
UPDATE
table_to_update,
table_info
SET
table_to_update.col1 = table_info.col1,
table_to_update.col2 = table_info.col2
WHERE
table_to_update.ID = table_info.ID
xxxxxxxxxx
UPDATE table_name
SET column_name1 = value1, column_name2 = value2
WHERE condition;
xxxxxxxxxx
UPDATE Table_A SET Table_A.col1 = Table_B.col1, Table_A.col2 = Table_B.col2 FROM Some_Table AS Table_A INNER JOIN Other_Table AS Table_B ON Table_A.id = Table_B.id WHERE Table_A.col3 = 'cool'
xxxxxxxxxx
UPDATE table_name
SET column1 = value1, column2 = value2,
WHERE condition;