2
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 1 year has passed since last update.

Bigquery | UNION ALL ではカラム順だけを見ている (後方のカラム名は無視される)

Last updated at Posted at 2018-06-15

(2018年6月15日現在)

カラムの順番だけを見て最初のテーブルに UNION されていく模様。

(カラム名が違っても気にしない)

SELECT
  *
FROM (
  SELECT
    'value' AS column_name)
UNION ALL (
  SELECT
    'value' AS another_column_name)

image.png

例2

2番目のテーブルでは順番だけを見ている。
カラム名を入れ子にしても気にしない。

SELECT
  *
FROM (
  SELECT
    'value1' AS column_name,
    'value2' AS another_column_name )
UNION ALL (
  SELECT
    'value3' AS another_column_name,
    'value4' AS column_name )

image.png

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

2
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
2
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?