以标准SQL格式编写旧版视图 [英] write Legacy views in Standard SQL format

查看:113
本文介绍了以标准SQL格式编写旧版视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望更新我的大查询表:

I wish to update my big query table :

FROM [myProject.Mydataset.ga_sessions_20171129]

我可以将它更新为标准SQL格式:

I can update it to a standard SQL format:

 FROM `myProject.Mydataset.ga_sessions_20171129`

ga_sessions_20171129是我的表格ID,它的名字的最后一部分显示了表格更新的最后日期,因此第二天的下一个表格将是20171130

ga_sessions_20171129 is my table id and the last part of its name shows the last date that the table is updated, so the next table for the next day will be 20171130

我该如何写这样的东西?

How do I write something like that?

from `ga_sessions_*` where _TABLE_SUFFIX=TODAY

每天更新日期到今天的日期

That updates the date every day to today's date

推荐答案

下面是BigQuery标准SQL


$ b

Below is for BigQuery Standard SQL

FROM `project.dataset.ga_sessions_*` 
WHERE _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d', CURRENT_DATE())

这篇关于以标准SQL格式编写旧版视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆