Category Archives: SQL Functions

In the SQL functions category you can find articles and tutorials containing information about a specific Excel function. Each article contains the syntax of the function and an example of its use on some specific example.

Don’t miss out from category:

SQL Error – Conversion failed when converting the varchar value to data type int

The error message “Conversion failed when converting the varchar value to data type int” occurs in SQL Server client (for example Management Studio) when attempting to convert a value stored as the varchar (text) data type to an integer data type. This might not be an issue if the varchar contains numeric values, but problems… Read More »

SQL ISNULL vs COALESCE Functions – What Are The Differences And Usage

ISNULL and COALESCE are functions used for work with null values (NULL). Both functions return first value out of previously defined entry parameters. There are also some differences between both functions. ISNULL Syntax: SELECT ISNULL(<Column>, <Column Replacement – other column or logic>) FROM dbo.Table  COALESCE Syntax: SELECT COALESCE(<Column>, <Column Replacement – other column or logic… Read More »

SQL String Functions – Overview of Text Functions in T-SQL

T-SQL is not a language designed primarily to do something big with text strings or manipulate with them. That is the reason why we will not find many text-related built-in functions. But we will definitely find use for those that are there. Let’s take a look at SQL String Functions. Text Concatenation (Combining) – CONCAT… Read More »

SQL Server Ranking Functions – ROW_NUMBER, RANK, DENSE_RANK, NTILE

SQL ranking functions enable us to rank records in the table based on values of a field or multiple fields. Clause OVER() is mandatory for the ranking functions. Ranking functions belongs to the group of Window functions. Aggregate functions and Offset functions (for paging) also belong to this group. List of Ranking Functions ROW_NUMBER ()… Read More »

SQL OFFSET (Window) Functions – LAG, LEAD, FIRST_VALUE, LAST_VALUE

OFFSET functions are relatively new to MS SQL Server. They are available since SQL Server 2012 version. These functions enable a user to “list” through rows of a table. To be precise, it makes you able to put hand on previous or next row while still at the current one. These functions belong to a… Read More »