在 Snowflake 中创建日期时间间隔为 15 分钟的表
我试图以15分钟的间隔在雪花上创建一张桌子。我已经尝试使用发电机,但这并不是在15分钟内给出的。我可以使用任何功能来生成和构建该表数年,值得数据。
例如
日期 | 小时 |
---|---|
202-03-29 | 02:00 AM |
202-03-29 | 02:15 AM |
202-03-29 | 02:30 AM |
202-03-29 | 02:45 AM |
202-03-29 | 03:00 AM |
202 -03-29 | AM |
03:15 | ............................................................................................ |
| |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用以下作为间隔为 15 分钟的时间生成器,然后根据需要使用其他日期时间函数在单独的列中提取日期部分或时间部分。
Use following as time generator with 15min interval and then use other date time functions as needed to extract date part or time part in separate columns.
这个问题有很多答案 e < /a> e 已经(这4个都是这个月)。
但是要注意的主要点是,您不得将
seqx()
用作数字生成器(您可以按顺序使用它,但不需要)。如 doc选择顶部/底部:
There are many answers to this question h e r e already (those 4 are all this month).
But major point to note is you MUST NOT use
SEQx()
as the number generator (you can use it in the ORDER BY, but that is not needed). As noted in the doc'sthen selecting the top/bottom:
Snowflake 具有
TIME_SLICE
函数。请参阅文档取决于您的计算方式想要转换它们,您可以使用
START
或END
slice。输出将如下所示
Snowflake has the function
TIME_SLICE
. See documentationDepending on how you want to convert them you can use either
START
orEND
slice.The output will looks as follows