A regular expression is a rule which defines how characters can appear in an expression. It’s a sequence of character or text which determines the search pattern. In SQL databases, selecting values based on regular expressions defined in the WHERE condition can be very useful. Following are a few use cases of how you can use regular expressions. Read More
In my previous article, I explained the basics of set operators, their types, and prerequisites for their use. I also talked about UNION and UNION ALL operators, their usage and differences.
In this article, we’re going to learn the following:
- EXCEPT and INTERSECT operators.
- Difference between INTERSECT and INNER JOIN.
- The detailed explanation of INTERSECT and EXCEPT with an example.
EXCEPT and INTERSECT operators were introduced in SQL Server 2005. Both are set operators used to combine the result sets generated by two queries and retrieve the desired output. Read More
This article is focused on the T-SQL Not Equal comparison operator (<>) and its uses in basic to slightly complicated SQL scripting tasks.
The article also highlights the importance of understanding the correct use of Not Equal comparative operator with expressions.
The Not Equal comparative operator is a very common operator used in T-SQL, however, it is important to understand how to use it effectively in different scenarios.
In SQL Server, we can combine the same type of data from multiple tables using SET operators. After combining multiple SQL statements, it returns one result set. Following is the list of T-SQL SET operators:
- UNION ALL
To use SET operators, we must follow a number of rules:
- The result set of both queries must have the same number of columns.
- The data type of columns retrieved by the top and bottom queries must be the same.
- If we want to sort the final result set, the ORDER BY clause must be at the end of the query.
- The positional ordering of the columns returned by the top and bottom queries must be same. Read More
In this article, we’ll look into the “APPLY” operator and its variations – CROSS APPLY and OUTER APPLY along with examples of how they can be used.
In particular, we will learn:
- the difference between CROSS APPLY and the JOIN clause
- how to join the output of SQL queries with table-evaluated functions
- how to identify performance issues by querying dynamic management views and dynamic management functions.