# Blogs from Wise Owl on Calculations in SQL

Showing blogs 1-8 (out of 8)

Introducing three new functions in SQL to make concatenating text easier

Posted by Andy Brown on 20 September 2019

The CONCAT function makes it much easier to join columns together, while the STRING_AGG and CONCAT_WS functions make it easier to create things like comma-delimited lists.

Tags:   SQL | Calculations

Did you know there was an IIF function in SQL to test conditions? We didn't!

Posted by Andy Brown on 16 February 2018

You can use the IIF function in SQL as an alternative to the CASE WHEN statement. We thought we would share this new (for us) discovery with the world!

Tags:   SQL | Calculations

Is the new(ish) FORMAT function in SQL Server slow?

Posted by Andy Brown on 16 January 2017

SQL Server 2012 saw the introduction of the T-SQL FORMAT function, making it easier to present dates nicely (no more remembering CONVERT arguments such as 103!). But is it too slow to be really useful? This blog aims to test this scientifically.

Tags:   SQL | Calculations

How to use the LAG and LEAD functions included in SQL Server 2012

Posted by Andy Brown on 20 September 2013

SQL Server 2012 introduces new functions to find the previous or subsequent value for a row, without using a complicated self-join. This blog explains how to use LAG and LEAD, including partitioning row sets.

How to do calculations and expressions in T-SQL

Posted by Andy Brown on 11 December 2012

You can use SQL to do everything from simple arithmetic through to complicated functions - this blog gives you the low-down!

Tags:   SQL | Calculations    |    T-SQL | SQL Tutorial

Calculating Age in SQL with a User-Defined Function

Posted by Andrew Gould on 16 February 2012

A common requirement in SQL queries is calculating a person's age. The expression you need to do this accurately is relatively long, so why not replace it with a user-defined function? This blog shows you how!

Free SQL training

Posted by Andrew Gould on 13 February 2012

This article provides a comprehensive tutorial in Microsoft SQL Server, taking you from the basics of writing SELECT statements all the way through to creating complex stored procedures.

Dates and Times in SQL Server

Posted by Andrew Gould on 13 February 2012

Dates and times can be the most frustrating data types to work with in SQL Server. Learn everything you need to know about the way dates work with this handy blog series and enjoy happier times!