接回上次,http://bbs.csdn.net/topics/390311052?page=1#post-393162401update points_summary ps inner join
(select eo.uid,eo.equipmentid,ei.getjf from equipment_operate eo ,equipment_info ei
,game_roomrecord gr where not exists(select 1 from equipment_operate where eo.uid=uid
and eo.operateid<operateid) and eo.equipmentid=ei.equipmentid) c
on ps.uid=c.uid AND gr.status=0
set ps.Points=ps.Points+c.getjf,Update_date=NOW();这次我想对另外一个表进行插入记录
INSERT into points_detail pd values (c.uid,c.getjf,'sleepperhour',NOW(),1) inner JOIN
(select eo.uid,eo.equipmentid,ei.getjf from equipment_operate eo ,equipment_info ei
,game_roomrecord gr where not exists(select 1 from equipment_operate where eo.uid=uid
and eo.operateid<operateid) and eo.equipmentid=ei.equipmentid) c WHERE
pd.uid=c.uid AND gr.status=0;貌似不太行
(select eo.uid,eo.equipmentid,ei.getjf from equipment_operate eo ,equipment_info ei
,game_roomrecord gr where not exists(select 1 from equipment_operate where eo.uid=uid
and eo.operateid<operateid) and eo.equipmentid=ei.equipmentid) c
on ps.uid=c.uid AND gr.status=0
set ps.Points=ps.Points+c.getjf,Update_date=NOW();这次我想对另外一个表进行插入记录
INSERT into points_detail pd values (c.uid,c.getjf,'sleepperhour',NOW(),1) inner JOIN
(select eo.uid,eo.equipmentid,ei.getjf from equipment_operate eo ,equipment_info ei
,game_roomrecord gr where not exists(select 1 from equipment_operate where eo.uid=uid
and eo.operateid<operateid) and eo.equipmentid=ei.equipmentid) c WHERE
pd.uid=c.uid AND gr.status=0;貌似不太行
select ....
select c.uid,c.getjf,'sleepperhour',NOW(),1 from points_detail pd inner JOIN
(select eo.uid,eo.equipmentid,ei.getjf from equipment_operate eo ,equipment_info ei
,game_roomrecord gr where gr.status=0 and not exists(select 1 from equipment_operate where eo.uid=uid
and eo.operateid<operateid) and eo.equipmentid=ei.equipmentid) c
on pd.uid=c.uid ;
select null, c.uid,c.getjf,'sleepperhour',NOW(),1 from points_detail pd inner JOIN
(select eo.uid,eo.equipmentid,ei.getjf from equipment_operate eo ,equipment_i…
INSERT into points_detail
select NULL, c.uid,c.getjf,'sleepperhour',NOW(),1 from points_detail pd inner JOIN
(select eo.uid,eo.equipmentid,ei.getjf from equipment_operate eo ,equipment_info ei
,game_roomrecord gr where gr.status=0 and not exists(select 1 from equipment_operate where eo.uid=uid
and eo.operateid<operateid) and eo.equipmentid=ei.equipmentid) c
on pd.uid=c.uid ;
OR
INSERT into points_detail(F1,F2,...FN)
select c.uid,c.getjf,'sleepperhour',NOW(),1 from points_detail pd inner JOIN
(select eo.uid,eo.equipmentid,ei.getjf from equipment_operate eo ,equipment_info ei
,game_roomrecord gr where gr.status=0 and not exists(select 1 from equipment_operate where eo.uid=uid
and eo.operateid<operateid) and eo.equipmentid=ei.equipmentid) c
on pd.uid=c.uid ;