SQLServerCentral Editorial

Creating Test Data

This editorial was originally published on Jan 9, 2020. It is being re-run as Steve is out of town. Test data is hard to come by, and I agree with Brent Ozar: " I get so frustrated when I hear trainers/presenters/bloggers/idealists talk about how developers should be using purpose-built-from-scratch data sets with no real customer […]

PostgreSQL 101: Getting started with PostgreSQL for SQL Server Developers (AEST and SGT Time Zones)

In the first two webinars, we've discussed why PostgreSQL has become such a force in recent years and some of the main differences for SQL Server users to know.
In this follow-up webinar, find out how to take your first steps using PostgreSQL.

Join Ryan Booz, PostgreSQL Advocate at Redgate, and discover:
-The freely available options to help you get started
-The essential tools you will need when using PostgreSQL
-Some learning resources to help you take the next steps

External Article

PostgreSQL 101: Getting started with PostgreSQL for SQL Server Developers (CT and BST Time Zones)

In the first two webinars, we've discussed why PostgreSQL has become such a force in recent years and some of the main differences for SQL Server users to know.
In this follow-up webinar, find out how to take your first steps using PostgreSQL.

Join Ryan Booz, PostgreSQL Advocate at Redgate, and discover:
-The freely available options to help you get started
-The essential tools you will need when using PostgreSQL
-Some learning resources to help you take the next steps

SQLServerCentral Editorial

Trust!

The difference between a low trust society (few individuals within a trust circle outside your family and/or tribe) and a high trust society (general trust of individuals beyond immediate family/tribe associations) generally speaking can be measured as the difference between a low tech (low trust) and high tech (high trust) society. Yes, exceptions abound, but […]

Blogs

Counting Groups with Window Functions: #SQLNewBlogger

By

I looked at row_number() in a previous post. Now I want to build on...

Extending a SQL Server Failover Cluster Across Regions in  Google Cloud Platform (GCP)

By

I was the principal author of this SIOS whitepaper, which describes how to build...

Read the latest Blogs

Forums

How to determine if a DB is currently being used

By dax.latchford

Hi - I'm looking for advice regarding the best & quickest way to establish...

Data cleansing/conversion tool HPE

By juliava

Hello.   I am looking for a tool Data cleansing/conversion, was recommended HPE any...

System views in a contained availability group

By mark4data

I have a query that runs in a job to check on orphaned users....

Visit the forum

Question of the Day

The LAGging NULL

I have this data in a SQL Server 2022 table:

player         yearid team HR
Alex Rodriguez 2012   NYY  18
Alex Rodriguez 2013   NYY  7
Alex Rodriguez 2014   NYY  NULL
Alex Rodriguez 2015   NYY  12
Alex Rodriguez 2016   NYY  9
If I run this code, what are the results returned in the hrgrowth column?
SELECT
  player
, yearid
, hr
, hr - LAG (hr, 1, 0) IGNORE NULLS OVER (ORDER BY yearid) AS hrgrowth
FROM dbo.playerstats;

See possible answers