KaskoazulUntitled Query
Updated 2022-02-07
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
--with
--firsttable as (
-- select 'provide' as type, 1 as value
-- union select 'provide' as type, 2 as value
-- union select 'provide' as type, 3 as value
--),
--secondtable as (
--select 'withdraw' as type, 4 as value
-- union select 'withdraw' as type, 5 as value
-- union select 'withdraw' as type, 6 as value
-- union select 'withdraw' as type, 7 as value
--),
--final as (
--select type, value from firsttable
--union all
--select type, value from secondtable
--)
--select * from final
SELECT
Animals,
COUNT(ANIMALS)
FROM (
SELECT
case
WHEN (amount > 0 AND amount <= 1000) then 'MOUSE'
WHEN (amount > 1000 AND amount <=10000) THEN 'CAT'
WHEN (amount > 10000 AND amount <=100000) THEN 'DOG'
WHEN (amount > 100000 AND amount <= 1000000) THEN 'HORSE'
WHEN (amount > 1000000 AND amount <= 10000000) THEN 'ELEPHANT'
ELSE 'DINOSAUR'
END as ANIMALS
FROM algorand.account_asset
WHERE
Run a query to Download Data