डिप्लोमा इन ऑफिस मैनेजमेंट एण्ड अकाउटिंग

डिप्लोमा इन ऑफिस मैनेजमेंट एण्ड अकाउटिंग

Full Stack Web Development with Laravel

Full Stack Web Development with Laravel

Affiliate Program

Affiliate Program

MYSQL update query

An update query is used to update records in the table.

For this query command, we will use the given table as an example.

Table: users
id first_name last_name email
1 Aman Singh aman@gmail.com
2 Rakesh Singh rakesh@gmail.com

 

Update records change first_name to Amit which has id 1

UPDATE users SET first_name="Amit" WHERE id=1;
Table: users
id first_name last_name email
1 Amit Singh aman@gmail.com
2 Rakesh Singh rakesh@gmail.com


Update multiple fields

UPDATE users SET first_name="Ramesh", last_name="Kumar" WHERE id=2;
Table: users
id first_name last_name email
1 Amit Singh aman@gmail.com
2 Ramesh Kumar rakesh@gmail.com

© 2016 - 2023, All Rights are Reserved.