sql server - Compare only same PlayerId in sql -
how can compare same playerid first select playersids other select ?
select playerid , sum([redeemedamount]) table1 group playerid order playerid select playerid, sum(redeemedbonusmoneygrosswinamount), sum(bonusmarketingcostamount)-sum(redeemedbonusmoneygrosswinamount), sum(redeemedbonuscashamount) table2 group playerid order playerid
results table1 are
playrid redeemedamount -1 0.000000 1136 0.000000 1145 216.000000 1147 368.000000 1148 108.000000 1155 0.000000
results table2 are
playerid value1 value2 redeemedbonuscashamount 1136 0.000000 0.000000 0.000000 1145 0.000000 216.000000 216.000000 1147 -180.000000 368.000000 368.000000 1148 50.000000 108.000000 108.000000 1177 0.000000 0.000000 0.000000 1188 0.000000 188.000000 188.000000 1198 0.000000 0.000000 0.000000
inner join
select * table1 t1 inner join table2 t2 on t1.playerid=t2.playerid
Comments
Post a Comment