mysql - Update sql row without deleting data -
is possible such thing?
update news set article_title="["+id+"]" + article_title;
is possible process query every row in news table? want add id of article article title this: [1000] stackoverflow
kind regards!
yes is:
update news set article_title=concat('[',id,'] ',article_title);
you add trigger on table news
update automatically. this:
create trigger trg_news before insert on news each row begin new.article_title = concat('[',id,'] ', new.article_title); end;
note trigger work on insert
command. because update
have parse article_title
don't end like: [1] somename[1] somename