5
2

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 5 years have passed since last update.

BigQueryで"FROM dual"する

Last updated at Posted at 2017-11-11

BigQueryで何のテーブルも参照しないクエリを投げるにはどうすればいいんだろう?と疑問に思ったのですが、単にFROM句を書かなければいいだけでした。

SELECT DATE_TRUNC(DATE "2016-12-25"), MONTH)

image.png

上記のようにFROM句なしのクエリを使えば、関数の挙動を簡単に確認することができます。

上記の例ではレガシーでない方のSQLを利用していますが、レガシーSQLでも同様にFROM句なしのSQLが利用できます。

5
2
1

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?