2,497
社区成员
发帖
与我相关
我的任务
分享
INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name [(col_name,...)]
VALUES (expression,...),(...),...
INSERT INTO SELECT语句:
INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name [(col_name,...)]
SELECT ...
INSERT INTO语句:
INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
[INTO] tbl_name
SET col_name=expression, col_name=expression, ...
mysql> INSERT INTO tbl_name (col1,col2) VALUES(15,col1*2);
mysql> INSERT INTO tbl_name (col1,col2) VALUES(col2*2,15);
INSERT INTO `mbbs_threads` (`tid`, `fid`, `iconid`, `typeid`, `readperm`, `price`, `author`,
`authorid`, `subject`, `dateline`, `lastpost`, `lastposter`, `views`, `replies`, `displayorder`,
`highlight`, `digest`, `rate`, `blog`, `special`, `attachment`, `subscribed`, `moderated`, `closed`,
`itemid`, `supe_pushstatus`) select `tid`+3000000, `fid`+21, `iconid`, `typeid`, `readperm`,
`price`, `author`, `authorid`, `subject`, `dateline`, `lastpost`, `lastposter`, `views`, `replies`,
`displayorder`, `highlight`, `digest`, `rate`, `blog`, `special`, `attachment`, `subscribed`,
`moderated`, `closed`, `itemid`, `supe_pushstatus` from mbbs_threads where fid='1520'
INSERT INTO `mbbs_posts` (`fid` , `tid` , `first` , `author` , `authorid` , `subject` , `dateline` , `message` , `useip` , `invisible` , `anonymous` , `usesig` , `htmlon` , `bbcodeoff` , `smileyoff` , `parseurloff` , `attachment` , `rate` , `ratetimes`) select `fid`+21 , `tid`+3000000 , `first` , `author` , `authorid` , `subject` , `dateline` , `message` , `useip` , `invisible` , `anonymous` , `usesig` , `htmlon` , `bbcodeoff` , `smileyoff` , `parseurloff` , `attachment` , `rate` , `ratetimes` from mbbs_posts where fid='1520'