它看起来像#comment其余的句子,但是如果我们尝试将它包含在执行命令中会抛出错误。(假设由于文本在#符号后变成灰色而导致的注释) 我知道没有官方文档表明 # 用于雪花中的评论。但是我们在雪花中使用 // 或 -- 进行注释。 任何人都知道雪花中# 符号的用途/含义/等效性是什么。
P.S- 我问这个是因为我来自 SQL Server 后台,其中 # 用于创建临时表。
示例:
select * from aa// random comment;
; -- no issue at all
#select * from aa;
select * from aa //select * from aa;
;--SQL compilation error: syntax error line 1 at position 0 unexpected '#s'.
答案 0 :(得分:1)
据我所知,“#”符号在雪花中没有语法意义。
与 SQL Server 类似,Snowflake 中也有临时表:https://docs.snowflake.com/en/user-guide/tables-temp-transient.html
临时表在 SQL Server 和 Snowflake 中有些相似,但重要的是要知道 Snowflake 中的临时表: