标签:rom mysql 图片 字符串 dup 环境 def sign 复制
create table tb_demo(
id int unsigned auto_increment primary key,
title varchar(50) not null default '',
contents text,
add_time int unsigned default 0
);
insert into tb_demo (title,contents,add_time) values
('#1 title 001','CONTENT 001 ABCD 1111',unix_timestamp()),
('#2 title 002','CONTENT 002 ABCD 2222',unix_timestamp()),
('#3 title 003','CONTENT 003 ABCD 3333',unix_timestamp()),
('#4 title 004','CONTENT 004 ABCD 4444',unix_timestamp());
预览:\
下面的语句实现了:
mysql> insert into tb_demo (title,contents,add_time) select concat(id,'__',title),concat('COPY_',contents),unix_timestamp() from tb_demo order by id desc limit 3;
Query OK, 3 rows affected (0.07 sec)
Records: 3 Duplicates: 0 Warnings: 0
执行结果:
标签:rom mysql 图片 字符串 dup 环境 def sign 复制
原文地址:https://www.cnblogs.com/mslagee/p/9566322.html