Last time, we talked about a query using the Query_History_By_User table function in Snowflake. This time, I want to discuss a similar table function named Query_History_By_Session. Thankfully, it works in a very similar fashion to Query_History_By_User. SELECT * FROM TABLE(SNOWFLAKE.INFORMATION_SCHEMA.QUERY_HISTORY_BY_USER()) ORDER BY START_TIME DESC; Yes, it shows the same information as Query_History_By_User, so I am…… Continue reading Querying History By Sessions in Snowflake
Author: Kevin
Cool Items in Snowflake that Aren’t in SQL Server
Yes, I know. The name of today’s post is certainly clickbait. But it’s true! There are so many things you can do in Snowflake that may – or may not – be possible in SQL Server, at least not without several tricks and possibly low-level querying. So, let’s start shall we? What did I run?…… Continue reading Cool Items in Snowflake that Aren’t in SQL Server
Common Table Expressions Can Be A Good Thing
Most of our coding these days has Common Table Expressions, also known as CTEs. If not, you’re either working on an older version of SQL Server or you haven’t been introduced to this piece of goodness. CTEs can make reading SQL queries a lot easier if the logic is convoluted. For example, let’s use the…… Continue reading Common Table Expressions Can Be A Good Thing
That’s Just NOT Right
Today, I want to talk about the keyword NOT in SQL Server. It can be your friend or your worst enemy depending upon how you use it. Let’s delve into some examples of what I’m talking about and how it’s easy for people to mess it up. Let’s say we have a table named DataTable.…… Continue reading That’s Just NOT Right
Basic Analysis of Data with Snowflake
Now and again, you’ll be asked to do some basic analysis of your data in Snowflake. Now by “basic analysis,” I mean for each column tell how many rows are populated, what’s the largest and smallest value in the column, etc… Some of you will want to review each and every column of every table…… Continue reading Basic Analysis of Data with Snowflake
Scrutinizing the Data in All of our tables
Today, I was working with SQL Server to get row counts from several tables so I thought I’d be smart and work with some functions in SQL Server to make it smarter / easier. Now, if I am truly only getting “straight” row counts from these tables, I would be able to create a query…… Continue reading Scrutinizing the Data in All of our tables
Removing Objects Is Not So Simple
When you’re working between SQL Server and Snowflake, there can be a lot of crossover that may make you forget what system you’re working in. Sometimes it’s close, but not close enough. Today, let’s go over something that should be rather simple – removing old objects that we shouldn’t need any longer. In SQL Server,…… Continue reading Removing Objects Is Not So Simple
Walking Through Advent of Code Day 9 Part 2
Welcome back after a long, much-needed break! Hopefully, you’ve had time to reenergize and are now ready to start 2024 with a bang! Thankfully, the elves were semi-nice to us for part 2 and only slightly changed their requests and wanted us to find the first number in the solution instead of the last. If…… Continue reading Walking Through Advent of Code Day 9 Part 2
Walking Through Advent of Code Day 9
And so day 9 begins. Today, our elves are working hard on having us come up with the next number in a sequence. Thankfully, they do give us a few good examples to walk through on how they would like us to do it. And with that, it’s off to the races! As always, we…… Continue reading Walking Through Advent of Code Day 9
Walking Through Advent of Code Day 8 Part 2
With Day 8 part 1 being all about traversing tables, I’m sure our little friends the elves will find a new way to make this harder for us. First, we find out that we’re now starting with multiple positions – anything that ends with an A – and finishing anywhere that ends in a Z.…… Continue reading Walking Through Advent of Code Day 8 Part 2