Using columns in window function that are not in Group By, I get : SQL compilation error: [COLUMN_A] is not a valid group by expression

I’ve seen a lot of questions about this error, the closest one (as it’s using window function) to my issue would be this one My issue is that I use columns in the windows function that are not …

execute multiple create view statements in snowflake

Is there a way to create multiple views in one query in Snowflake? I keep getting error when I try this – create or replace view forecast_view as select * from forecast where variable = ‘Name’ go …

Adding a calculated column while joining tables in Snowflake

I have 4 tables A, B, C and D with 3 columns each A- aa, ab, ac B- ba, bb, bc C- ca, cb, cc D- da, db, dc I need to join the 4 tables and add a new calculated column (aa + ab + ac). My query …

SQL – Find Record count for multiple tables at a time in snowflake

I want to see counts have Tables at 1 time, instead of Running each. For EX: select COUNT(*) from “Fact_MASTER “; select COUNT(*) from “Dim_MASTER “; select COUNT(*) from “…

Tasks in snowflake – multiple SQLs

Can a Task execute multiple SQLs at a time in single transaction? I know stored procedure does but wanted to see if we can start a transaction in task and execute multiple SQLs

SnowFlake Convert_timezone function format mapping

Problem My 24 timezone codes are like EAT, ICT, NZT and I need to use the SnowFlake Convert_timezone function to convert the American Eastern time to the timezone that the records have. But SnowFlake …

How to perform indirect references into a variant column?

I’m determining the structure/query I would need to handle indirect references into a variant column (i.e. I want to extract different fields for different rows based on the definitions of another …

Last_Value returning the current value

I am not able to get the last value, rather it is just returning the same value with my code below in snowflake – does anyone have any idea? Is there something glaring wrong? select MNTH, …

Snowflake SQL, how to lookahead until a certain occurrence of a value

Below is a sample of the text that I am working with. — info1: * val: “A” — Type: * answers: * – ! * val: “B” * – ! * val: “C” — info2: * val: “D” — …

SQL Function: Get next value in row

I’m looking for an SQL way to get the value from the next row. The data I have looks like: CURR_STRT_DT CUUR_END_DT product 6/30/2019 9/28/2019 A 6/30/2019 9/28/…