Update method is used to update existing records in a table.
Note: Be careful when updating records in a table! Notice the WHERE clause in the UPDATE statement. The WHERE clause specifies which record(s) should be updated. If you omit the WHERE clause, all records in the table will be updated!
Syntax
Update( x =>
x.From( Table | SubSelect )
.LeftJoin( (Table | SubSelect), Condition )
.RightJoin( (Table | SubSelect), Condition )
.InnerJoin( (Table | SubSelect), Condition )
.Where( Condition )
.SetModel( model )
.Set( Field , value )
.SetRaw( Field , Expression )
.SetNull( Field ) )
)
Examples
Regular
Using SET
With Join