insert into temp (ids, user_ids, user_id, phone, type) select '1 sd212, u.i ds, u.u ser_ids, u.t elephone, from 1 (coupon_dtl CD left join coupon c on CD. Coupon_id=Arthur c. oupon_id) left the join mst_users u on u.i ds=CD. User_ids where u.d elete_flag=0 and Arthur c. oupon_type=1 and CD. Active_state=1 and datediff (Arthur c. oupon_active_date, now ()) & gt;=3;
The SQL prompt warning, also can be inserted into the data, is has been submitted to the warning, solving
CodePudding user response:
Check to see if you TEMP table each field type assignment match back with you,CodePudding user response:
Match, the one with a decimal, I remove the other fields, leaving only a phone inserted or at the wrong, also don't know how to return a responsibilityCodePudding user response:
Post show create table... For analysis,CodePudding user response:
Show create tableThe CREATE TABLE ` temp ` (
` ids ` varchar (50) NOT NULL,
` user_ids ` varchar (32) NOT NULL,
` user_id ` varchar (32) NOT NULL COMMENT 'user id',
` type ` decimal (10, 0) NOT NULL DEFAULT '0' COMMENT 'the result type,
` phone ` varchar (32) NOT NULL COMMENT 'phone number',
` create_time ` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'add time,
PRIMARY KEY (` ids `)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='add timing task table scan results, as a result, for timing when scanning needs in this table'
CodePudding user response:
You also need to stick downSd212 select '1', u.i ds, u.u ser_ids, u.t elephone, from 1 (coupon_dtl CD left join coupon c on CD. Coupon_id=Arthur c. oupon_id) left the join mst_users u on u.i ds=CD. User_ids where u.d elete_flag=0 and Arthur c. oupon_type=1 and CD. Active_state=1 and datediff (Arthur c. oupon_active_date, now ()) & gt;=3;
Involves several table table structure,
May be the select '1 sd212, u.i ds, u.u ser_ids, u.t elephone, 1 from... Among the several fields more than the value of the length of the length of the field you temp tables, so an error,
CodePudding user response: