Query editor
with gotchis as (select _tokenId , json_extract_scalar(output_aavegotchiInfo_, '$.name') as name,Cast(json_extract_scalar(output_aavegotchiInfo_, '$.baseRarityScore') as decimal) as baseRarityScore ,cast(json_extract_scalar(output_aavegotchiInfo_, '$.modifiedRarityScore') as decimal) as modifiedRarityScore , cast(json_extract_scalar(output_aavegotchiInfo_, '$.kinship') as decimal) as kinshipfrom aavegotchi_polygon.aavegotchi_diamond_call_getAavegotchiwhere call_success)--where call_successselect ROW_NUMBER() OVER(ORDER BY max(modifiedRarityScore) desc) AS "Rank modified BRS", ROW_NUMBER() OVER(ORDER BY max(baseRarityScore) desc) AS "Rank base BRS", ROW_NUMBER() OVER(ORDER BY max(kinship) desc) AS "Rank Kinship",CONCAT ('<a href="https://app.aavegotchi.com/gotchi/',replace("_tokenId", '\', '0'),'" target="_blank" >',replace("_tokenId", '\', '0'),'</a>') as Gotchi_id, name, max(baseRarityScore) as baseBRS, max(modifiedRarityScore) as modifiedRarityScore, max(kinship) as kinshipfrom gotchisgroup by 4,5order by modifiedRarityScore desc