forgashgoogle-sheets-demo copy copy
    Updated 2024-09-05
    -- 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