I'm trying to get the count from garage_list:account_id
get 1 instance from there and get the corresponding player_list:account_id
also garage_list:tank_id
to tank_list:tank_id
end table will look like:
tank :: count (alt text on count for players)
IS-3 :: 2 --> ( player 1, player 3)
E-100 :: 3 --> (player1, player 4, player 9)
Select Count(Distinct tank_id) As
counttanks ,
Count(tank_id) As
counttanks ,
tank_id As tank_id From garage_list
RIGHT JOIN player_list
ON player_list.account_id = garage_list.account_id
RIGHT JOIN tank_list
ON player_list.tank_id = tank_list.tank_id
Group By tank_id
where tank_list.level='8',
and player_list.clan='BAD-1'
and player_list.account_id = '500549663'
TABLES
<garage_list>
account_id :: tank_id
1234 :: 20
1234 :: 44
4321 :: 18
<tank_list>
Tank_id :: name :: long_name :: row1 :: row2 :: row3 ::
20 :: sherman::usa_sher
<player_list>
account_id :: clan :: nickname
1234 ::bad-1:: joker
4321 ::bad-g :: grumpy