Query editor
WITH tokenId_and_tba AS (SELECTCAST(json_extract_scalar(block, '$.tokenId') AS double) AS tokenId,CAST(json_extract_scalar(block, '$.wallet') AS varchar) AS wallet,CAST(json_extract_scalar(block, '$.owner') AS varchar) AS owner,CAST(json_extract_scalar(block, '$.isHibernating') AS boolean) AS isHibernatingFROM UNNEST(CAST(json_parse(http_get('http://159.69.221.108:9999/api/sanko/pets/tba')) AS array(json))) AS t(block))SELECTCASE WHEN isHibernating = true THEN 'Hibernating' ELSE 'Not Hibernating' END as type,-- COUNT(tokenId) as total_hatched,COUNT(tokenId) as amountFROMtokenId_and_tbaGROUP BY isHibernatingORDER BY type DESC