Query editor
/*MIT LicenseCopyright (c) 2024 Berry_BearPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.Follow me on X: https://x.com/DeFi_Berry_Bear*/-- Beardy contract: 0x85bF0746F1D8B7968E760cf2537EA638c6C335B1WITH incAS(SELECTSUM(amount) AS inc,"to" AS wallyFROM nft.transfersWHERE "blockchain" = 'mantle'AND "contract_address" = 0x85bF0746F1D8B7968E760cf2537EA638c6C335B1GROUP BY "to"),outAS(SELECT-SUM(amount) AS out,"from" AS wallyFROM nft.transfersWHERE "blockchain" = 'mantle'AND amount != 0AND "contract_address" = 0x85bF0746F1D8B7968E760cf2537EA638c6C335B1GROUP BY "from"ORDER BY 1 DESC)SELECT*FROM (SELECT'Total holders' AS label,COUNT(*) AS holders_countFROM (SELECTCOALESCE(inc.inc, 0) AS inc,COALESCE(out.out, 0) AS out,COALESCE(inc.wally, out.wally) AS wallyFROM incFULL OUTER JOIN outON inc.wally = out.wally) AS combinedWHERE (combined.inc + combined.out) >= 1UNION ALLSELECT