Updated 2022-10-23
    with buytable1 as (
    select NFT_TO_ADDRESS ,TOKENID ,(MINT_PRICE_ETH) as MINT_PRICE_ETH ,(MINT_PRICE_USD) as MINT_PRICE_USD ,tx_hash ,BLOCK_TIMESTAMP::DATE AS MINT_TIME
    from ethereum.core.ez_nft_mints
    where NFT_ADDRESS='0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03'
    and EVENT_TYPE ='nft_mint'
    and MINT_PRICE_ETH > 0 and MINT_PRICE_USD > 0 ),

    selltable1 as (
    select MIN(BLOCK_TIMESTAMP) AS DATE ,seller_address, tx_hash, tokenid, price_usd,price
    FROM ethereum.core.ez_nft_sales
    WHERE EVENT_TYPE = 'sale' and CURRENCY_SYMBOL = 'ETH'
    and lower(NFT_ADDRESS)=lower('0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03')
    and price_usd > 0 and price > 0 GROUP BY 2,3,4,5,6 ORDER BY DATE )


    select case
    when "hold time " <1 then '< 1 day '
    when "hold time " between 1 and 5 then ' 1 - 5 day '
    when "hold time " between 5 and 10 then ' 5 - 10 day '
    when "hold time " between 10 and 20 then ' 10 - 20 day '
    when "hold time " between 20 and 50 then ' 20 - 50 day '
    when "hold time " between 50 and 100 then ' 50 - 100 day '
    when "hold time " between 100 and 200 then ' 100 - 200 day '
    when "hold time " between 200 and 400 then ' 200 - 400 day '
    when "hold time " > 400 then '> 400 day '
    end as "average hold time for traders in day"
    ,count(distinct trader) as traders
    from (select
    DISTINCT NFT_TO_ADDRESS as trader,
    'https://www.nftscan.com/0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03/' ||t1.tokenid as "token id",
    datediff('day',MINT_TIME,date) as "hold time "
    --T2.price || ' - '||T1.price || ' = ' as "Sale PRICE - bought PRICE (ETH)" ,
    --sum (t2.price_usd - t1.price_usd) as USD_Profit
    --sum (t2.price - t1.price) as ETH_Profit
    Run a query to Download Data