forgashgoogle-sheets-demo copy copy
Updated 2024-09-05Copy Reference Fork
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
›
⌄
-- forked from theericstone / google-sheets-demo copy @ https://flipsidecrypto.xyz/theericstone/q/AJSGCkMc7Gtv/google-sheets-demo-copy
-- forked from charliemarketplace / google-sheets-demo @ https://flipsidecrypto.xyz/charliemarketplace/q/bFnJ2s0TdbVp/google-sheets-demo
with res AS (
SELECT
livequery.live.udf_api(
'GET',
'https://science.flipsidecrypto.xyz/googlesheets/readsheet',
{ 'Content-Type': 'application/json' },
{
'sheets_id' : '1isXwTpJlxMClz1Kg0tkSNMwhd8Z944IgprPULx_aqWg',
'tab_name' : 'Sheet1'
}
) as result
from DUAL
),
data AS (
select result:data as json_result_must_pivot from res
)
SELECT
d.value:"ID"::VARCHAR as ID,
TO_NUMBER(d.value:"Value") as Value,
d.value:"Class"::VARCHAR as Class
FROM
data,
LATERAL FLATTEN(input => data.json_result_must_pivot::VARIANT) d
QueryRunArchived: QueryRun has been archived