Query editor
with pepe AS (SELECT tx_from , sum(amount_usd) as Total_amount_PEPE_BoughtFROM dex.tradesWHERE token_bought_address = 0x6982508145454ce325ddbe47a25d4ec3d2311933 --PEPEgroup by 1order by 2) ,PepeStreetBets AS (SELECT tx_from , sum(amount_usd) as Total_amount_PepeStreetBets_BoughtFROM dex.tradesWHERE token_bought_address = 0x365c2345cc178b5920f6f9c131b14594ea99fa78 -- PepeStreetBetsgroup by 1order by 2),bob AS (SELECT tx_from , sum(amount_usd) as Total_amount_bob_BoughtFROM dex.tradesWHERE token_bought_address = 0x7D8146cf21e8D7cbe46054e01588207b51198729 -- bobgroup by 1order by 2),total as (select pepe.tx_from as Address ,Total_amount_PEPE_Bought , Total_amount_PepeStreetBets_Bought , Total_amount_bob_Boughtfrom pepeleft join PepeStreetBets on PepeStreetBets.tx_from = pepe.tx_fromleft join bob on bob.tx_from = pepe.tx_from)select CONCAT('<a href="https://debank.com/profile/',CAST(Address as varchar), '" target="_blank" >' , CAST(Address as varchar), '</a>') as DeBank, Total_amount_PEPE_Bought , Total_amount_PepeStreetBets_Bought ,Total_amount_bob_Bought , ( Total_amount_PEPE_Bought + Total_amount_PepeStreetBets_Bought + Total_amount_bob_Bought ) as TOTL_Boughtfrom totalorder by Total_amount_PepeStreetBets_Bought desclimit 50