Select Distinct Logo Clear Background

Explaining User-Defined Types in SQL Server?

User-Defined Types in SQL Server

Having recently stumbled on User-Defined Types (UDTs) in SQL Server. I thought I’d write a blog to explain what user-defined types are? Why you should you use them? This blog post delves into what UDTs are, why they are useful, and how to use them in SQL Server. What are User-Defined Types (UDTs)? In SQL […]

SQL Server Date Handling

date handling in SQL Server

Handling dates is one of the most challenging parts of data manipulation. In this blog we aim to describe some of the complexities of date handling in SQL Server. Data Types Prior to Microsoft SQL Server 2008 the only data types available were datetime or the smalldatetime. With the launch of SQL Server 2008 saw […]

The Microsoft Fabric Offering

Microsoft Fabric

Introduction Microsoft Fabric, the unified environment launched in 2023 is now central to Microsoft’s data strategy. What is the Microsoft Fabric Offering? What is Microsoft’s competition to this software? What other unified environments are available. This blog aims to demystify some of these areas. What is the Microsoft Fabric Offering? Microsoft Fabric brings together multiple […]

Top SQL Tips for 2023

Top 5 SQL Tips and Timesavers 2023

Top SQL Tips and Timesavers for 2023 Highlighting our top 5 SQL tips for 2023 based on popularity   1. Our most popular SQL tip this year How to calculate running totals in SQL server why you would use them, and provides a breakdown of the syntax The article gives a step by step example […]

How to use a CTE? Should you use this “With” your SQL code?

What is a SQL CTE

Introduction CTEs in SQL are a way to simplify code by creating a temporary dataset, giving it a name, then referencing that dataset later in your query You can use Common Table Expressions (CTEs) as temporary named result sets within a SELECT, INSERT, UPDATE, or DELETE statement. You may also have heard of them described […]

When to transform data

When to transform data for Power BI

As a general principle we should always look to transform data close to its source to gain efficiencies and minimise potential for discrepancies Over the last few weeks we have shown how data can be combined from multiple sources in three different ways UNION in SQL APPEND data in Power Query UNION in DAX A […]

UNION in SQL

Combine data with union in SQL

A Guide to Using UNION in SQL: Combining and Manipulating Data Introduction: Understanding the Purpose and Functionality of UNION in SQL The SQL UNION operator allows us to merge the results of two or more SELECT statements into a single result set. It performs a set operation by combining rows from different tables based on […]

Joins in SQL

Joins in SQL: a simple guide

Joins in SQL: A simplified guide Introduction to joins in SQL This guide is aimed at explaining in simple terms the different types of joins between tables in SQL We use simplified real life examples combining data from Products, Stores, Sales and Inventory What we will not do unlike other guides we have seen is […]

Automatically reformat SQL

automatically reformat SQL code with this free tool

Automatically format SQL with this great free tool At Select Distinct we love to share tips and timesavers to help you become more efficient, and when we find great tools we love to share this knowledge (We have no affiliation to this product or site and get no commercial benefit from it) PoorSQL.com is a […]

Group by ROLLUP function in SQL Server

How to use ROLLUP in SQL Server

Introduction to ROLLUP in SQL Server Did you know that there is a simple way to add roll up sub totals in SQL Server? SQL ROLLUP is an extension of the GROUP BY clause in SQL, providing a way to generate subtotals and grand totals for multiple dimensions within a dataset. It enables analysts to […]