<budget_ name>!GET_ SPENDING_ HISTORY¶
View the spending history for a budget.
- See also:
语法
可选实参
TIME_LOWER_BOUND => constant_expr,
TIME_UPPER_BOUND => constant_expr支出发生的时间范围(UTC 时间戳格式)。
您必须同时设置时间下限和时间上限,以便根据时间范围限定结果。
返回
该函数返回以下列:
| Column Name | Data Type | Description |
|---|---|---|
| MEASUREMENT_DATE | DATE | Date when the usage occurred. |
| SERVICE_TYPE | VARCHAR | Type of service that is consuming credits, which can be one of the following:
|
| CREDITS_SPENT | FLOAT | Number of credits used. |
访问控制要求
-
查看 自定义预算 的结果需要以下最低权限和角色:
- Any instance role for the budget instance.
- 对包含预算实例的数据库和架构的 USAGE 权限。
- Snowflake database role USAGE_VIEWER.
-
需要以下角色才能查看 账户预算 的结果:
- Any application role for the account budget.
- Snowflake database role USAGE_VIEWER.
For more information, see Budgets roles and privileges.
使用说明
Calling this method does not return the object. Because of this, you can’t use method chaining to call another method on the return value of this method. Instead, call each method in a separate SQL statement.
示例
View the spending history for budget my_budget in schema budget_db.budget_schema:
查看账户预算最近 7 天的支出历史记录: