How to update a MySQL table column without erasing the existing data -
i have table ticket column comments. want mysql query can add values comments without erasing stored data. new data should added in new line.
for example if present content of coloumns table abc , new data def should update database def(in 1st line) , abc (in second line)
i have used below query. works here hitting database abc;def
update ticket set comments = concat( coalesce( comments ) , 'def' ) ticket_id =235; here ticket_id primary key.
i assume want put new line or carriage return , newline combination in separator.
just newline
update ticket set comments = concat('def', coalesce(concat(char(10),comments),'')) ticket = 25; or crlf:
update ticket set comments = concat('def', coalesce(concat(char(13),char(10),comments),'')) ticket = 25;
Comments
Post a Comment