Creating Dynamic Pivot Table with QUOTENAME Function
In my previous article on the basic pivot operator, we saw how pivot operator could be used to...
Methods to Rank Rows in SQL Server: ROW_NUMBER(), RANK(), DENSE_RANK() and NTILE()
SQL Server provides us with a number of window functions that help us to perform calculations across a set of rows, without the need to...
Understanding Pivot Operator in SQL
The pivot operator in SQL Server converts each row in the aggregated result set into corresponding columns in the output set. The pivot...
Query Optimization in PostgreSQL. EXPLAIN Basics – Part 2
In my previous article, we started to describe the basics of the EXPLAIN command and analyzed what...
Query Optimization in PostgreSQL. EXPLAIN Basics – Part 1
Why does it take so much time to execute a query? Why are there no indexes? Chances are you’ve heard about EXPLAIN in PostgreSQL....
Oracle Regular Expressions. Dangerous Range
An Oracle developer who often uses regular expressions in code sooner or later can face a phenomenon that is indeed mystical. Long-term...
Eliminating Duplication of Where Expressions in Application
Assume you have products and categories. A client says that it is necessary to use other business...
Better ALTER than DROP
In this article, I am going to provide a construction for deleting an object before creating it....
What Can Query Plan Tell?
Introduction SQL query describes the expected result, not the way to get the result. The set of specific steps the server must take to...
Optimizing Overlapping Queries Part 1: Introduction & Enhanced T-SQL Solution
Databases that serve business applications should often support temporal data. For example, suppose...