Misc MySQL UPDATE Examples

UPDATE - Single row

Update a single row of data.

START TRANSACTION
;

UPDATE students
SET    
       customer_id_fk                = '23099-56'  ,
       marital_status_code           = 'M'  ,
       fin_alert_code                = '3'  
WHERE  student_id = 11  
;

COMMIT 
;

UPDATE - Update multiple rows

Update multiple rows of data..

START TRANSACTION
;

UPDATE employeesaffiliates
SET    relationship_type_code        = '1'  ,
       employee_inactivating         = 0 
WHERE  person_id is not null 
;

COMMIT 
;