Oracle

H. G. Wells and SQL: Traveling in the Second Dimension

H. G. Wells and SQL: Traveling in the Second Dimension

SQL is traditionally one-dimensional in that you can access values in a row, in the horizontal dimension. SQL Server 2012's support of LAG and LEAD and other so-called window functions open up the vertical dimension, giving access to all values in a column. 

Creating Pivot Tables

Creating Pivot Tables

Pivot tables are incredibly useful when writing certain types of SQL queries, because they let you generate rows that do not otherwise exist. Here are several ways to create them. (There is also a CONNECT BY approach that is well-known on the Internet, but that I have never gone back and added to this article).