Below is how my table is
create table tab (id INT, fullname varchar(100));
Data is
insert into tab values
(1,'Full Name 1'),
(2,'Full Name 2'),
(3,'Full Name 3'),
(4,'Full Name 4'),
(5,'Full Name 5'),
(6,'Full Name 6');
I want to update the table with fullname
as My Full Name is + actuallfullname
. e.g. data for id 1 should be My Full Name is Full Name 1
.
Any idea how to get this done in one query?
Using below query, it would be executing n times as I have so many records.
UPDATE tab SET fullname='My Full Name is Full Name 1';
Use CONCAT
.
UPDATE tab
SET fullname = CONCAT('My Full Name is ', fullname)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With