binhachon15. AB2 Gallery NFTs - Asset ID
    Updated 2022-01-31
    with AB2_gallery_txs as (
    select
    distinct tx_group_id
    from algorand.application_call_transaction
    where try_base64_decode_string(tx_message:txn:note::string) = 'ab2.gallery'
    ),
    payment as (
    select
    tx_group_id,
    count(tx_group_id) as number_of_transactions,
    count_if(amount > 0) as number_of_transactions_with_amount_not_null
    from algorand.payment_transaction
    where tx_group_id in (select tx_group_id from AB2_gallery_txs)
    group by tx_group_id
    ),
    asset_ID as (
    select
    tx_group_id,
    count(distinct asset_id) as number_of_asset_id
    from algorand.asset_transfer_transaction
    where tx_group_id in (select tx_group_id from payment where number_of_transactions = 2 and number_of_transactions_with_amount_not_null = 2)
    group by tx_group_id
    )
    select
    number_of_asset_id,
    count(*)
    from asset_ID
    group by number_of_asset_id
    order by number_of_asset_id

    Run a query to Download Data