Using GROUP BY and HAVING

In this post by John Deardurff (@SQLMCT), we discuss how to use the GROUP BY and HAVING clause in a T-SQL statement.


NULL Values and Aggregate Functions

In a previous post, we introduced aggregate functions and mentioned that these functions ignore NULL values. This could give us results that we did not expect or intend. However, there are several ways to handle this issue. First, for this example, we will create a table named CountTable with a…


Using Aggregate Functions

In a previous post, we discussed the concepts of functions and using scalar functions. In this post, we will focus on Aggregate functions that are used in SQL to take a series of values and return a singular result. For example, in the AdventureWorks database, there is a Sales.SalesOrderHeader table…


What is a Function?

What is a SQL Function? John Deardurff (@SQLMCT) explains how to use a function in a T-SQL statement.


Sort Records using ORDER BY

When writing a SELECT statement the records are returned in an unsorted order. To ensure that the records being returned are sorted in a specific order, we would use the ORDER BY statement. (Note: There are some performance issue concerns when using the ORDER BY statement that will be discussed…


Filtering Records by NULL Values

In a previous post, we discussed how to write a select statement. Over the next several posts we will discuss how to use the WHERE keyword to filter records by numbers, character data, dates and times, and NULL values. This post specifically will focus on filtering records by NULL Values….


Filtering Records by Dates and Times

In a previous post, we discussed how to write a select statement. Over the next several posts we will discuss how to use the WHERE keyword to filter records by numbers, character data, dates and times, and NULL values. This post specifically will focus on filtering records by dates and…


Filtering Records by Character Data

In a previous post, we discussed how to write a select statement. Over the next several posts we will discuss how to use the WHERE keyword to filter records by numbers, character data, dates and times, and NULL values. This post specifically will focus on filtering records by character data….


Filtering Records by Numbers

In a previous post, we discussed how to write a select statement. Over the next several posts we will discuss how to use the WHERE keyword to filter records by numbers, character data, dates and times, and NULL values. This post specifically will focus on filtering records by integer numbers….


Columns and Records

In this post, we discuss what columns and records are in a SQL table. Also an explanation of objects and entities.