Tag Archives: MSSQL

SQL Order By Cheat Sheet

This is a cheat sheet that I have put together for keeping track of the results of ordering different types of columns in ASC and DESC order and the rules around each.  This order is fairly standard for most ANSI database servers.  However I do not believe that there is anything in the ANSI spec that dictates this as a requirement.

Continue reading SQL Order By Cheat Sheet

Using JOIN for Suppression

We usually use JOIN to find the intersection between two different tables.  For example, if you want all the orders from the order table who belong to a certain set of customers from the customer table.

This is the most common usage of a JOIN, specifically an INNER JOIN.  The results only include the entries that matchup from each table.  There are many other situations that you can incorporate a JOIN to solve.  Particularly here we are going to talk about using a JOIN to suppress information from one table by using another. Continue reading Using JOIN for Suppression