mysql 使用变量

insert into news(id,title,Ncontent,newsUrl)value(id,'我是标题','我是内容','chanyeguihua.html');
SET @id= last_insert_id();
update news set newsUrl =replace(newsUrl,'.html',concat(@id,'.html')) where id=@id;

  

posted @ 2017-03-31 16:22  G善源  阅读(74)  评论(0编辑  收藏  举报