You are looking to find a way to find the first non-null value from a list of fields. In this post, we look at SQL COALESCE - a wonderfully useful tool that helps to solve that problem. To help demonstrate this, we will talk about a hypothetical scenario where a number of customer leads have been added to a table from different sources and the consistency of data found in … [Read more...] about Using SQL COALESCE to Find the First Non-NULL Value
sql
Data Management – Finding, Removing Duplicate Rows Using SQL and Some Prevention Tips
Duplicate data is a common problem and in my experience comes in two main flavours; exact duplicate data and similar data. Exact duplicate data is when a data source contains the same values across all fields in the record. Similar data is when some of the fields match and to the naked eye can be classed as duplicate data but in fact it isn't - it's similar data and therefore … [Read more...] about Data Management – Finding, Removing Duplicate Rows Using SQL and Some Prevention Tips
T-SQL – Derived Tables Demonstrated and Explained
T-SQL is a very powerful language when dealing with sets and in this post, I am going to be demonstrating how to use derived tables. Derived tables are not the same as a temporary or physical tables where the fields and data types are declared. Nor are they subqueries. Instead, as the name implies, the table is derived from an existing table. I liken them to views but a view … [Read more...] about T-SQL – Derived Tables Demonstrated and Explained
How to Determine SQL Server Version Number In Various Ways
It's important to be able to determine SQL Server version number. DBA's need to know what SQL Server version numbers they are supporting so that during patching windows, they can source and apply the correct patches or service packs. This information is useful as a reference to what issues may be contained in a certain build that could affect production. The DBA can quickly … [Read more...] about How to Determine SQL Server Version Number In Various Ways