Query editor
select 1 AS ordering, '1 day' AS period, count(price_decimal) as nr_sales, sum(price_decimal) as sales_eth, sum(usd_price_decimal) as sales_usdfrom reservoir.saleswhere contract in (0x300e7a5fb0ab08af367d5fb3915930791bb08c2b)and token_id = regexp_extract('{{Drop}}', '^.')and is_primary = FALSEand tx_timestamp_dt > (NOW() - interval '1' day)UNION ALLselect 2 AS ordering, '7 days' AS period, count(price_decimal) as nr_sales, sum(price_decimal) as sales_eth, sum(usd_price_decimal) as sales_usdfrom reservoir.saleswhere contract in (0x300e7a5fb0ab08af367d5fb3915930791bb08c2b)and token_id = regexp_extract('{{Drop}}', '^.')and is_primary = FALSEand tx_timestamp_dt > (NOW() - interval '7' day)UNION ALLselect 3 AS ordering, '30 days' AS period, count(price_decimal) as nr_sales, sum(price_decimal) as sales_eth, sum(usd_price_decimal) as sales_usdfrom reservoir.saleswhere contract in (0x300e7a5fb0ab08af367d5fb3915930791bb08c2b)and token_id = regexp_extract('{{Drop}}', '^.')and is_primary = FALSEand tx_timestamp_dt > (NOW() - interval '30' day)UNION ALLselect 4 AS ordering, '90 days' AS period, count(price_decimal) as nr_sales, sum(price_decimal) as sales_eth, sum(usd_price_decimal) as sales_usdfrom reservoir.saleswhere contract in (0x300e7a5fb0ab08af367d5fb3915930791bb08c2b)and token_id = regexp_extract('{{Drop}}', '^.')and is_primary = FALSEand tx_timestamp_dt > (NOW() - interval '90' day)UNION ALLselect 5 AS ordering, 'ALL TIME' AS period, count(token_id) as nr_sales, cast(sum(price_decimal) as decimal(5,2)) as sales_eth, sum(usd_price_decimal) as sales_usdfrom reservoir.saleswhere contract in (0x300e7a5fb0ab08af367d5fb3915930791bb08c2b)and token_id = regexp_extract('{{Drop}}', '^.')and is_primary = FALSEORDER BY ordering asc