SELECT COUNT Behaviour

by Allan Svelmøe Hansen April 17, 2008 12:51

Saw this blog piece over at Conor Cunningham's Blog and wanted to point to it, because I never knew this behaviour.


SELECT COUNT(*) returns the number of rows in a table, but when you do SELECT COUNT(<Column>) it will return the non-null number of rows. Nifty - but behaviour which is immensely important to actually know.

Bookmark and Share DotnetKicks dotnetshoutout

Tags: ,

SQL

Powered by BlogEngine.NET 1.6.1.0
Theme by Mads Kristensen | Modified by Mooglegiant

About:
Allan Svelmøe Hansen

My real name is Allan Svelmøe Hansen.
I live in Denmark, where I work as a developer for hedal:kruse:brohus using SQL Server and the .NET framework since 2004.
My primary fields of expertise is back-end data integration, database design and optimization.


       View Allan Svelmøe Hansen's profile on LinkedIn     

Disclaimer

The opinions expressed herein are my own personal opinions and thoughts and does not represent my employers view in any way, nor are my results guaranteed for all situations.
Content is presented "as is", with no warranty.