SQL LAG and LEAD Window Functions: Explained

Reading Time: 9 minutesThe SQL Server LAG and LEAD functions are simple window functions you should know to help you gather meaningful information from your data. Window functions are considered an advanced tool when querying data in SQL Server. If you’re trying to learn about window functions, congratulations, you’re moving up! The LAG and Continue Reading

FIRST_VALUE and LAST_VALUE: SQL window functions you should know

Reading Time: 9 minutesThe SQL Server FIRST_VALUE and LAST_VALUE functions are simple window functions you should know to help you gather meaningful information from your data. Window functions are considered an advanced tool when querying data in SQL Server. If you’re trying to learn about window functions, congratulations, you’re moving up! The FIRST_VALUE Continue Reading

SQL Server Offset Window Functions: FIRST_VALUE, LAST_VALUE, LAG, LEAD

Reading Time: 12 minutesOffset window functions are very useful tools you should know when querying databases in Microsoft SQL Server. There are several different window functions available to us. You should know all of them if you want to be the world’s best database developer. In this tutorial, we’re going to discuss the four Offset Continue Reading

What’s the difference between RANK and DENSE_RANK? Answered!

Reading Time: 5 minutesThe RANK and DENSE_RANK window functions in SQL Server are very handy when you need to gather ranking information from your data. But do you know the difference between the two? The difference is subtle, but important. This tutorial assumes you know a thing or two about window functions in Continue Reading

SQL Server RANK: A window function you should know

Reading Time: 9 minutesThe SQL Server RANK function is a simple window function you should know to help gather meaningful information from your data. Window functions are considered an advanced tool when querying data in SQL Server. If you’re trying to learn about window functions, congratulations, you’re moving up! The RANK function is Continue Reading

SQL Server ROW_NUMBER: A window function you should know

Reading Time: 8 minutesThe SQL Server ROW_NUMBER function is a simple window function you should know to help you gather meaningful information from your data. Window functions are considered an advanced tool when querying data in SQL Server. If you’re trying to learn about window functions, congratulations, you’re moving up! The ROW_NUMBER function Continue Reading