Rollup and Cube Part 3

By Greg No comments

In the previous 2 posts we have looked at how Rollup and Cube work. This time we’re going to look at how you might implement these in the real world. I don’t think ROLLUP has a great use in the real world (feel free to comment below if you have a real use for it). […]

Rollup and Cube Part 2

By Greg No comments

Previously in Part 1, we looked at the ROLLUP keyword that can be applied to SQL Select queries. We are now going to look at the similar, but different CUBE keyword. As we saw last time, the ROLLUP keyword would sum each part of the GROUP BY and give you a running total. The CUBE […]

Rollup and Cube Part 1

By Greg No comments

I have recently come across these 2 keywords: ROLLUP and CUBE. These keywords allow you to get running totals when you group by some data. In this post we’ll have a look at how ROLLUP works, and in the next post we’ll see how CUBE works, and then in the final post we’ll look at […]

Query Hints

By Greg No comments

SQL Server has a couple of keywords that can be added to a query to give the query optimizer some ideas on how to best compile your SQL statements. Hints like FORCE ORDER, MAXDOP and NOEXPAND can be used as a way to tell the optimizer “Hey, I’ve got this idea, you should try it.” […]