在MYsql下
select qq.player_id,sum_cz,pz,position,gem1,gem2,magic3,reduce_dmg,monopoly
from
(SELECT b.player_id,right(type,1) as pz,position,gem1,gem2,magic3,reduce_dmg,monopoly
from cq_user a INNER JOIN cq_item b
on a.id=b.player_id and a.`level`>=120 and a.last_login>=20120301 and position>0 and position<19
) qq
LEFT JOIN
(select id_target,sum(case when number=120 then 1.9 when number=530 then 7.99 when number= 1075 then 15.99 when number=60 then 0.99 when number=125 then 1.99 when number=320 then 4.99 else 29.99 end ) as sum_cz
from e_money where time_stamp>=1203010000 and type in (6,8) and id_source>10000
group by id_target
) pp
on pp.id_target=qq.player_id
group by qq.player_id,sum_cz,pz,position,gem1,gem2,magic3,reduce_dmg,monopoly提示出错:SELECT b.player_id,right(type,1) as pz,position,gem1,gem2,magic3,reduce_dmg,monopoly 这边有错 ?? 求教一下
select qq.player_id,sum_cz,pz,position,gem1,gem2,magic3,reduce_dmg,monopoly
from
(SELECT b.player_id,right(type,1) as pz,position,gem1,gem2,magic3,reduce_dmg,monopoly
from cq_user a INNER JOIN cq_item b
on a.id=b.player_id and a.`level`>=120 and a.last_login>=20120301 and position>0 and position<19
LEFT JOIN
(select id_target,sum(case when number=120 then 1.9 when number=530 then 7.99 when number= 1075 then 15.99 when number=60 then 0.99 when number=125 then 1.99 when number=320 then 4.99 else 29.99 end ) as sum_cz
from e_money where time_stamp>=1203010000 and type in (6,8) and id_source>10000
group by id_target
) pp
on pp.id_target=qq.player_id
group by qq.player_id,sum_cz,pz,position,gem1,gem2,magic3,reduce_dmg,monopoly提示出错:SELECT b.player_id,right(type,1) as pz,position,gem1,gem2,magic3,reduce_dmg,monopoly 这边有错 ?? 求教一下
(SELECT b.player_id,right(type,1) as pz,position,gem1,gem2,magic3,reduce_dmg,monopoly
from cq_user a INNER JOIN cq_item b
on a.id=b.player_id and a.`level`>=120 and a.last_login>=20120301 and position>0 and position<19
) qq
中的select 部分是否正确。