update query where clause in sql code example
Example 1: sql update query
--update query example
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
Example 2: soql update query
SOQL is a query language. It has no support for operations besides Read. If you want to perform other CRUD operations, you will need to make different calls. Within Apex, that would look like:
List<MyObject__c> records = [SELECT ... FROM MyObject__c WHERE ...];
for (MyObject__c record : records)
{
// set some fields
}
update records;