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?

More than 3 years have passed since last update.

BigQueryでクエリ結果をJSONで取得する

Last updated at Posted at 2021-12-09

やりたいこと

  • BigQueryにて、クエリ結果をJSONで取得する

やりかた

SELECT TO_JSON_STRING(t) FROM (SELECT hoge, fufa FROM sample_table) AS t

SELECT TO_JSON_STRING(t) AS j
FROM (
    SELECT 
        "hoge" AS foo,
        "fuga" AS bar
    UNION ALL 
    SELECT
        "piyo" AS foo,
        "nya" AS bar
) AS t

image.png

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?