Distinct or Group By?

A few days ago, I heard someone stating that Group By was much quicker than Distinct. Less disk impact, less memory etc.So, I thought I'd find out if it's true or not because I found it interesting. I always thought there was no difference. I tested a single small table and found no difference in … Continue reading Distinct or Group By?

T-SQL Tuesday 155, Dynamic SQL

This month, Steve Jones (T) invites us to write about the way dynamic SQL helped us solve a problem. Case For one of our customers, we've had an interesting case. They have multiple schemas in the database and the schema's contain a lot of tables with different use cases. To grant user groups (not individual … Continue reading T-SQL Tuesday 155, Dynamic SQL

Fun ROWNUM() case, get n’th row from dataset.

Last week, one of my coworkers had a nice case. From a dataset, he needed the third row based on an indicator and a timestamp. That sounded a bit vague so I started out with creating a table that contained some records with the columns he'd have to filter on. CREATE TABLE dbo.demo ( id … Continue reading Fun ROWNUM() case, get n’th row from dataset.