1. 学习
  2. /
  3. 课程
  4. /
  5. Snowflake Architecture

Connected

练习

Filtering with session variables

Session variables in Snowflake let you store a value once and reference it in any query for the rest of your session using a $ prefix. They are a Snowflake-specific feature — useful for parameterising queries without hardcoding values.

The session variable $min_fee has been set to 49.99 (equivalent to running SET min_fee = 49.99). The snowy_peak.subscriptions table has columns subscription_id, user_email, plan, status, start_date, and monthly_fee.

说明

100 XP
  • Query snowy_peak.subscriptions to return plan and monthly_fee for all subscriptions where monthly_fee is greater than or equal to the session variable $min_fee.
Powered by Snowflake