I am trying to separate out a clip if it has the same date. For example, since “Clip Number” 1 and 2 has the same date so I am trying to make the date different by adding a 6 hour interval. I would like to add a new field that is similar to the column “New Date” Date Clip_Number New
Tag: snowflake-cloud-data-platform
For each distinct PK I have a mixture of TRUE/FALSE
If a PK has one YES value, I want all the other values to be YES. I am thinking going a CTE route that I join back in but was wondering if there is an easier way! I am trying to get my table to look like this if only one Y is in the table above.: Answer I strongly
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 …
Joining two JSON objects in Snowflake
What’s up, I have two JSON objects, generated from the same Snowflake table (Table 1 here). I want to join/merge them on their “_id” field, in order to produce this nested json kind of structure. How can I do this? I tried aliasing them and using SELECT * from dc JOIN rs ON rs.:_id = dc:_id but I’m hitting invalid
count sequence of particular value
I have a snowflake table like this: date_col | artc | locl | flag d1 | a1 | l1 | 0 d2 | a1 | l1 | 1 d3 | a1 | l1 | 1 d4 | a1 | l1 | 0 d5 | a1 | l1 | 0 d6 | …
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 – Snowflake Minus Operator
Hi I am running a query to check for any changes in a table between two dates…. The first select statement (where run_time = current_date() return 3,357,210 records. The second select statement (where run_time = current_date()-1 returns 0 records. Using the MINUS operator, I was expecting to see 3,357,210 records (3,357,210 – 0) but instead I get 2,026,434 Any thoughts
How can I split a string into character in Snowflake?
I need to split a string like “abc” into individual records, like “a”, “b”, “c”. This should be easy in Snowflake: SPLIT(str, delimiter) But if the delimiter is null, or an empty string I get the full str, and not characters as I expected. Answer Update: SQL UDF I found this problem while working on Advent of Code 2020. Instead
Compare JSON Values and identify the differences -Snowflake SQL
I am trying to compare the set of two JSON values for every transaction and extract specific values from the below.. I want to extract the following values cCode,dCode,hcps and mod..Can you please …
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 “…