mysql-查询并且添加数据


INSERT INTO 表 (yuesao_openid, user_openid,time) SELECT   xxxx as yuesao_id,id,'2017-11-23 10:09:24'as time
 from 表 LIMIT 20;   查询 20条数据 A表  并且给字段赋值 添加 到B 表


INSERT INTO t_belong_yuesao_vote (yuesao_id, user_openid,time)SELECT 'xxxxxx'as yuesao_id,openid,'2017-11-23 10:09:24'as time
 from t_user_info LIMIT 20;


你可能感兴趣的:(mysql)