Create a dynamic pivot function with multiple aggregate functions in Snowflake

  Рет қаралды 1,715

DotPi

DotPi

Күн бұрын

Пікірлер: 3
@jessicalenoir9979
@jessicalenoir9979 Жыл бұрын
This is great!! I have much to learn 😅. I was able to follow clearly and end up with exactly what I need. I need to join this output table to another few tables, though, and be able to reference it later. How do you get this result set table created as a real table? Stick a “CREATE OR REPLACE TABLE AS” somewhere?
@dotpi5907
@dotpi5907 Жыл бұрын
Great, that's really good to hear. A few people have asked about that, and it doesn't seem so straight forward. I'll look into what the best ways of doing that are and make that the next video. Thanks for the suggestions!
@dotpi5907
@dotpi5907 Жыл бұрын
Hi @jessicalenoir9979, I have an answer for you now. This was my mistake that it was difficult to put into a select statement, because I made the pibot into a 'stored procedure' rather than a 'user-defined function', see the difference here docs.snowflake.com/en/developer-guide/stored-procedures-vs-udfs. To define the dynamic pivot as a user-defined function you would use: create or replace function dynamic_pivot(... You could then select the result from the user-defined function using: select dynamic_pivot(...) Hopefully that helps, let me know if that works for you.
Create a Dynamic Pivot Stored Procedure in Snowflake
20:59
Do you love Blackpink?🖤🩷
00:23
Karina
Рет қаралды 23 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 105 МЛН
Pivot in sql server 2008   Part 54
12:25
kudvenkat
Рет қаралды 379 М.
SQL Window Functions in 10 Minutes
10:13
Colt Steele
Рет қаралды 89 М.
Why I Don’t Use Arrow Functions With const/let
6:48
Web Dev Simplified
Рет қаралды 186 М.
In-depth intuition on Snowflake Lateral Join
26:30
Knowledge Amplifier
Рет қаралды 2,4 М.
SQL Query | How to dynamically convert rows into columns | Dynamic Pivot
16:18
Solving SQL Query | Rows to Column in SQL
1:13:11
techTFQ
Рет қаралды 177 М.
Путин ответил на угрозы Трампа
7:21
Diplomatrutube
Рет қаралды 1,3 МЛН