Process Mining
2022.10
False
- 发行说明
- 在开始之前
- 入门指南
- 管理访问权限
- 使用流程应用程序
- 创建流程应用程序
- 正在加载数据
- 自定义流程应用程序
- 数据转换
- 在本地环境中编辑数据转换
- Setting up a local test environment
- SQL differences between Snowflake and SQL Server
- Designing an event log
- Structure of transformations
- Tips for writing SQL
- TemplateOne 应用程序模板
- “购买到付款”应用程序模板
- “订单到现金”应用模板
- Basic troubleshooting guide
SQL differences between Snowflake and SQL Server
Process Mining
上次更新日期 2024年4月19日
SQL differences between Snowflake and SQL Server
In a local development environment, transformations are run on SQL Server, while Snowflake is used in Process Mining Automation Suite. Although most SQL statements will work both on SQL Server and Snowflake, there can be slight differences in syntax, which may lead to different return results.
要编写可在两个数据库系统上运行的 SQL 语句,请执行以下操作:
- 用双引号将字段名称写入,例如
Table."Field"
。 -
防止使用 Snowflake 和 SQL Server 中不同的 SQL 函数,例如
string_agg()
和listagg()
。pm_utils
包附带一组可用于这两种数据库类型的函数,请参阅多个数据库。 例如,如果使用string_agg()
listagg()
pm_utils.string_agg()
,则两个数据库将产生相同的行为,而不是 或 。如果pm_utils
不包含所需的函数,则应创建Jinja语句,以确保在每个数据库上调用正确的函数。
要合并为字符串,请使用
pm_utils.concat()
函数。 这将为 SQL Server 和 Snowflake 生成相同的结果。
示例:
pm_utils.concat("This is a nice string", null)
= "This is a nice string"
不应使用+
或||
等运算符连接字符串,因为这两个数据库的运算符不同(Snowflake 使用||
,SQL Server 使用+
)。 此外,标准concat()
函数在两个系统上的行为也不同:
SQL 服务器 |
Snowflake |
---|---|
null 值将被忽略并被视为空字符串。
|
null 值将导致整个结果为null 。
|
在 Snowflake 和 SQL Server 中,排序的处理方式有所不同。
示例:
... order by "Attribute_1" desc, "Attribute_2" ...
当您按值“A”和“A”进行分组时,这在 SQL Server 中被视为一个值,但在 Snowflake 中被视为两个不同的值。 因此,如果您的数据可能会导致此问题,则建议进行修剪。