with eco_data as (select *,row_number() over (partition by player_id, currency_type order by timestamp desc) as rank from
(SELECT * FROM `heidao-market.mafia1_ods.game_log_economy_data` WHERE timestamp>"2020-08-19 05:08:25 UTC" and timestamp<"2020-08-19 09:08:25 UTC"))
select currency_change ,currency_type, currency_value ,player_id,timestamp from eco_data where rank=1