How to INSERT data in Nested Table from Nested Table BigQuery

前端 未结 2 1180
余生分开走
余生分开走 2021-01-28 21:29

I have 2 Nested Tables and I want to INSERT INTO each other.

I try this :

INSERT INTO table1 ( record.id, record.product.type, record.product.price )
SELEC         


        
相关标签:
2条回答
  • 2021-01-28 21:43

    you can use the APPLY operator to unpivot a table please visit this answer https://stackoverflow.com/a/27708046/1862306

    0 讨论(0)
  • 2021-01-28 21:56

    You can try this:

    INSERT INTO table1
    SELECT STRUCT(id, STRUCT(productPrice.type, productPrice.price)) FROM table2;
    
    0 讨论(0)
提交回复
热议问题