Skip to content

Tag: snowflake-cloud-data-platform

SQL Snowflake Column Condition Check

Basically, I am trying to write a query against a table such like the following. Here we have Plans of either Free, Plus or Premium (in the example below I only show free and plus plans). Is it possible to return records where an ID that was original a ‘Free’ plan has changed to either a ‘pl…

Setting rules for max() with strings

Each record in my table has a random selection of these strings, so it looks like I want to get the highest value of “fruit” for each record, except I want it to be sorted lower if it contains the string guava. This is the output that I’d like and I’m using Snowflake SQL output: Curren…