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
5,689 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
5,689 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
26,254 reads
2021-02-04
721 reads
2020-02-27
22,758 reads
Have you ever wanted to compute age, but the results from the DATEDIFF function seemed to be wrong some of the time? This tip covers why the DATEDIFF function does not always reliably compute age.
2012-05-23
4,752 reads
By Rob Sewell
The partner directory connects your agency with new customers.
I had an excellent group of people in Gothenburg Sweden when I taught there...
By Steve Jones
How can I quickly get a CU patch for a system that’s out of...
Comments posted to this topic are about the item GIT Configuration and Automated Release...
hi a peer of mine recalls an error in an edi app that often...
Hello SSC! First, I would like to thank everyone who has responded to my...
I have created these triggers in SQL Server 2022:
CREATE TRIGGER triggertest_tri_1 ON dbo.triggertest FOR INSERT AS PRINT 'one' GO CREATE TRIGGER triggertest_tri_2 ON dbo.triggertest FOR INSERT AS PRINT 'two' GOI want to be sure that the trigger with "1" runs first. I decide to run this:
EXEC sp_settriggerorder@triggername = 'triggertest_tri_1', @order = 'first'What happens? See possible answers