Query editor
SELECTo.address,COALESCE(ao.owner, '?') AS owner, -- Join to fetch owner informationSUM(o.value) AS balanceFROMbitcoin.outputs oLEFT JOINbitcoin.inputs iON i.spent_tx_id = o.tx_idAND o.index = i.spent_output_numberLEFT JOINdune.casey_btc.dataset_addressowners ao -- Join with the addressowners tableON o.address = ao.addressWHEREi.spent_tx_id IS NULL -- Output is not spentAND o.type != 'nulldata' -- Could also check script_asm NOT LIKE '%OP_RETURN%'AND o.address IS NOT NULL -- Ignore undecoded scriptsGROUP BYo.address,ao.owner -- Include owner in GROUP BY as it's now in SELECTORDER BYbalance DESCLIMIT 1000;