Snowflake filters

Snowflake – How to filter your data?

QUALIFY clause is a powerful feature of Snowflake – SQL, which allows you to filter the results of a query based on window functions. Window functions are special functions that operate on a set of rows defined by a window or a partition. These functions can be used to calculate aggregate values, ranking, or row...Continue reading

remove a user from database which owns a schema

How to drop the user with db owner privilege in SQL Server Instance: Error: 15138

When you try to drop the user from database which owns a schema in the database you will get the following error: “The database principal owns a schema in the database and cannot be dropped. (Microsoft SQL Server, Error: 15138)” The reason for this error is quite clear from the error message, as there is...Continue reading

adds results into subtotals and grand totals

How to use GROUPING SETS in ‘Group By’ aggregate function in SQL Server Instance

“GROUPING SETS” creates a group for each combination and adds results into subtotals and grand totals and displays only those calculations. It might actually be more convenient mostly to execute two different queries instead of GROUPING SETS because then one can have the grouped results separate from the totals. But GROUPING SETS will more efficient...Continue reading

Data Update Time

How to solve “Unknown Update time” error after adding a time of the last data refresh (a time stamp) to a view in a Tableau dashboard

In Tableau Desktop you can add last data refresh time / Update time (a time stamp) to the top of the view with following the below steps: Open your workbook and navigate to the sheet for which you would like to display the time of the last data refresh. Select Worksheet > Show Title. Double-click the title. In...Continue reading

select Second Nth highest value

11 different ways to select Second / Nth highest value in MS SQL Server Instance

Let’s discuss 11 different ways to select second highest value in MS SQL table. And as a bonus, 6 different ways to select the Nth highest value. I will be using a table called WorkOrder with three columns in it; WorkOrderID, ProductID, OrderQty. Here is a quick look to our table: WorkOrderID   ProductID   OrderQty 1   ...

ROLLUP in ‘Group By’ aggregate function

How to use ROLLUP in ‘Group By’ aggregate function in SQL Server Instance

The SQL Server GROUP BY ROLLUP is an extension of the GROUP BY clause that creates a group for each combination and adds results into sub-totals and grand totals. ROLLUP does not create all possible grouping sets based on the dimension columns. When generating the grouping sets, ROLLUP assumes a hierarchy among the dimension columns...Continue reading

Install SQL Server 2016 Service Pack 2 (SP2) and Cumulative Update 11 (CU11) Builds

How to Install SQL Server 2016 Service Pack 2 (SP2) and Cumulative Update 11 (CU11) Builds

Microsoft usually releases SP’s and CU’s to fix hundreds of bugs after the initial releases of the SQL Server 2016 RTM, and they have also has been adding a significant number of product improvements and new features after the RTM release. So, in my opinion each SQL Server SP’s and CU’s are very important hotfixes...Continue reading

Scroll to top