我可以选择插入到mysql但手动修改值吗?

vic*_*ick 4 mysql

insert into 
 keyword_history (
   keyword_id, 
   searchengine, 
   location, 
   "4", 
   curdate()
   ) 
 select 
  keyword_id, 
  searchengine, 
  location 
 from 
  keyword_history 
 where 
  history_id = 21
Run Code Online (Sandbox Code Playgroud)

基本上,我要做的是:

  1. 从表中选择一行
  2. 再次插入,但这次使用当前日期和值"4"

Dan*_*llo 12

是的你可以.您可能需要尝试以下方法:

INSERT INTO keyword_history 
(
   keyword_id, 
   searchengine, 
   location, 
   rec_date, 
   currentrank
) 
SELECT  keyword_id, 
        searchengine, 
        location,
        curdate(),
        '4' 
FROM    keyword_history 
WHERE   history_id = 21;
Run Code Online (Sandbox Code Playgroud)

编辑:根据下面的评论更新了字段名称.