All Questions
Tagged with snowflake-cloud-data-platform join
103
questions
0
votes
1
answer
13
views
Generate a record per date from another table date range
Good morning,
I am trying to generate a table in snowflake that will add a record for each date within a date range. I want to get the date range from start and end date and put a record in the new ...
0
votes
2
answers
49
views
SQL Select Most Common Column based on Group
I'm using Snowflake to query data and one of the tables has some issues that are out of my control.
There are several item id's that have the same item description for most records except for one. For ...
0
votes
1
answer
72
views
snowflake query is taking too much time to run
SELECT
category_tree_master__."category_id" AS category_id,
--searchchildrenmaster.children,
--ARRAY_CONTAINS(category_product_nb_stand_nb_product."category_id" ::...
0
votes
1
answer
94
views
Alternative to 'OR' condition in SQL 'JOIN'
Problem: I have a Sub-optimal query resulting in (what I consider to be) a high querying time.
Detail: I have a number of large tables (rows in the hundreds of thousands / millions) that require ...
0
votes
1
answer
51
views
Using CASE statement to exclude specific healthcare claims data
I have two Snowflake tables for member health claims. Table A has all of a clinic's claims, and Table B is just the clinic's claims filtered down to a specific year and specific services that I'm ...
0
votes
2
answers
55
views
SQL find and replace part of a column
I have 2 tables and I was wondering how to replace part of a column in table 1 with a value from table 2 in SQL?
I want to find value "Field1" within Region2 and replace it with "Field2&...
-2
votes
1
answer
58
views
Getting NULL VALUES FROM THIRD TABLE WHEN JOINED WITH OTHER TWO TABLES
I am trying to join a third table
"TERADATA"."PRD_DWH_VIEW_LMT"."ZZMMSPECPRO_V"
with the other two tables in Snowflake. However, I am getting NULL values when all three ...
0
votes
2
answers
778
views
Snowflake uses where-clause in wrong place when joining
I have views that I need to join, and these have filters to exclude records with invalid data. In the views the filtering is done before the remaing records are cast to their respecive data type, but ...
-2
votes
1
answer
33
views
SQL Query to modify the order of columns individually without affecting whole table based on matching values with another column
I want to write a SQL Query where I have a table and I have three columns with similar distinct values. I want to order the 2nd and 3rd columns in such a way that the rows where all 3 columns match ...
0
votes
0
answers
36
views
Implementing a sql constructor which takes a query, where condition, order by and join condition and construct a revised query
I'm trying to implement a query builder that has the capability to construct SQL query with dynamic where conditions, join condition and order by clauses.
Tried below approaches
Appending the ...
0
votes
1
answer
79
views
SELECT multiple columns, stored in a table
I have business rules applied in CASE statement of multiple stored procedure. Business rules have on going changes so I want to separate them out and store in a table. This will help to make changes ...
0
votes
0
answers
42
views
Align the same table with full join and union
I have the following database structure consists of 4 table and query in which represented joins that are required there:
-- table 1
create TABLE TBL_1 (
ID INT,
GOODS_ID INT,
CREATE_DATE ...
0
votes
1
answer
120
views
How to get the previous record in snowflake
I am trying to get the previous record of a pgft.name and pj.name in the below query, since it should return older data which may not be result set, LAG function cannot be used.
I am looking for 2 new ...
1
vote
1
answer
186
views
SQL Left Join in a many to many relationship situation
I am trying to collect some average survey scores on employees by location over time. These people can transfer locations over time for various reasons. I have 2 tables.
Survey_Scores: this table ...
0
votes
0
answers
215
views
update in snowflake table, if values not updated then set to 0
I am trying to update a table in snowflake with the results of a join. t1 looks like this
col1
col2
col3
1
a
1
2
b
0
3
c
1
table 2 looks like this they are matched on col1 a unique identifier
...