SQL Window Functions Series: LAG() and LEAD()
Dive deep into the powerful SQL window functions, LAG() and LEAD(). Explore their intricacies, discover real-world examples, and avoid common pitfalls.
2023-12-11
9,205 reads
Dive deep into the powerful SQL window functions, LAG() and LEAD(). Explore their intricacies, discover real-world examples, and avoid common pitfalls.
2023-12-11
9,205 reads
The most common method on the internet for combining DATE and TIME columns in SQL Server is incorrect. This article demonstrates why that and other methods are incorrect and two lesser known high performance methods that produce correct results even for the "edge cases".
2023-08-07
23,873 reads
Learn to calculate Start / First of Week, End of Week, Start of Next Week, Year, Quarter, and Month of the week, Week Numbers and more in T-SQL (Jeff Moden)
2022-07-13
33,838 reads
A function to add or subtract working days taking into account weekends and using a table of non-working days.
2019-07-10 (first published: 2019-06-26)
5,212 reads
2018-02-23 (first published: 2018-02-19)
160 reads
2017-12-29
1,092 reads
This script provides the day of the month for the standard bank holidays for any given year. This is especially useful for computing the workday after a holiday.
2017-05-24 (first published: 2017-05-10)
502 reads
By Steve Jones
I had a customer ask about analyzing their Test Data Manager (TDM) usage to...
By Steve Jones
I had an idea for an animated view of a sales tool, and started...
Next Monday, February 9, 2026, my one-day live online training SQL Server Query Tuning...
Comments posted to this topic are about the item SQL Server 2025 Query Performance...
This is a generic question. To the moderators, I wasn't sure where to place...
Good Afternoon, I have built a table with four columns: Period(Month), Category, Numerator, Denominator....
On SQL Server 2025, what happens when I run this code:
SELECT JSON_OBJECTAGG( 'City':'Denver') GOSee possible answers