0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

bigqueryのコンソール上で既存のテーブルにレコードを追加したい

Posted at

結論

以下のようにすることで追加できる

INSERT `project.dataset.product` (sku, description, quantity, price)
SELECT *
FROM UNNEST([
    ('GCH635354', 'Chair', 4, 345.7),
    ('GRD828822', 'Gardening', 2,9.5),
    ('ABC123456', 'Furniture', 3, 36.3),
    ('TBL535522', 'Table', 6, 878.4),
    ('CHR762222', 'Chair', 4, 435.6)
]);

参考: BigQuery 特集: データ操作(DML)

UNNESTは何をしているか

  • 配列を作成して、個別の要素を行として扱えるようにしている。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?