SQL Server: Dynamically Calculate Delta Values For Numeric And Date Columns From DMV’s Or Any Table

DMV's are very useful. In fact, they are like glass windows that lets you look at a running engine. There are lots of them and they give us lots of numbers but Most are cumulative in nature!  i.e., the numbers keep on increasing and never decrease. A variation of above like space usage where the … Continue reading SQL Server: Dynamically Calculate Delta Values For Numeric And Date Columns From DMV’s Or Any Table

Advertisements

Oracle ROWNUM vs. SQL Server TOP – Differences & How To Do Pagination In Both

Sometimes we carry knowledge around that can hurt when doing similar things especially when dealing with the different programming languages and constructs. Today, let us see how Oracle’s ROWNUM is different from (as in, almost unrelated) SQL Server’s TOP. SQL Server - TOP: Basics Let us take the TOP function in SQL Server. It is … Continue reading Oracle ROWNUM vs. SQL Server TOP – Differences & How To Do Pagination In Both

Oracle Tip – ORDER BY with NULLS LAST or NULLS FIRST

The purpose of this tip is to introduce you to an seldom-used by very useful clause within the ORDER BY of a SQL statement – NULLS FIRST or NULLS LAST. Here is a situation that I ran into: I was looking into the Oracle 11g system view v$sql_plan_monitor to find out the top execution plan … Continue reading Oracle Tip – ORDER BY with NULLS LAST or NULLS FIRST

Oracle/SQL Server – RANK, DENSE_RANK and ROW_NUMBER Analytic Functions – Basic Examples

Note: The illustrations on this post are done with Oracle. However, by making minor changes, you should be able to run it on SQL Server and the concepts remain the same. Please refer this post for changes needed. RANK, DENSE_RANK and ROW_NUMBER are three powerful analytic functions that every database developer should be thoroughly familiar … Continue reading Oracle/SQL Server – RANK, DENSE_RANK and ROW_NUMBER Analytic Functions – Basic Examples