mysql-クエリーとデータの追加

350 ワード

INSERT INTO表(yuesao_openid,user_openid,time)SELECT xxx 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;