SQLServerCentral Article

NULL Column Analysis

NULL values in columns can indicate a few things, the value isn't known, it's not yet been filled in, or perhaps, as Leo Peysakhovich argues, the column isn't being used? How many SQL Server tables do you have with extra tables and columns that are not being used? Or maybe never have been? This article looks at a statistical analysis of columns using NULLs to determine if you might be able to remove certain columns.

SQLServerCentral Article

Win One of 5 XBOXs!!!!

By now everyone should have heard about the PASS 2004 Summit in Orlando this September. Hopefully you are also aware that SQLServerCentral.com is one of the sponsors for this event and to make it a bit special, we're putting on a reception for everyone that registers for PASS with our promotion code. Read on to see what we've got planned!

Technical Article

Into Fantasy Football? Join the SQLServerCentral.com League.

If you're into fantasy football, come waste some time with us and join our free league at Yahoo. Read the below instructions on how to join. Space is limitted in the first league to 12 teams so join quickly and the draft starts Tuesday! If it's popular, we'll create other leagues.


In order to join the league, just go to http://football.fantasysports.yahoo.com/f1,
click the "Sign Up Now" or "Get Another Team" button and
follow the links to "Join a Custom League". When prompted,
enter the League ID# and password below.

League ID#: 525071

Password: ssc

Blogs

Free webinar – Tackling the Gaps and Islands Problem with T-SQL Window Functions

By

I’m hosting a free webinar at MSSQLTips.com at the 19th of December 2024, 6PM...

Counting Groups with Window Functions: #SQLNewBlogger

By

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

Read the latest Blogs

Forums

How to merge two tables with unlike fields

By landonh

How to merge two tables with unlike fields. I have two table with one...

Visual Studio 22 / SSIS Project / (Project) Connection problem

By WilburSmith

Hello, First of all, I find it odd/annoying that I can't exclude a Project...

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...

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