How to Use the OVER Clause in SQL Server 2008 R2

This tutorial will show how to use the OVER clause in SQL Server 2008 R2. The OVER clause exposes a window of rows to certain kinds of calculations. The window of rows is simply a certain set of rows that the calculation operates on. Only Aggregate and ranking functions are the types of calculations that …

How to Count Distinct Values in a Table In SQL Server

This tutorial will show how to create a query that retrieves a count of unique values in a column of a table. To make this query work, we will use the COUNT function and the DISTINCT statement. The COUNT function returns the number of rows that matches a specified definition and the DISTINCT statement can be …

How to Use the GETDATE Function in SQL Server

This tutorial will show you how to use the GETDATE function in SQL Server. The GETDATE function retrieves the current date and time from the SQL Server at run time. This function is very useful when working with time sensitive material, such as order dates. In this tutorial we will create a table of called …