After the past few blog posts, I’m sure you’re like “Sherpa! How many more things can we learn about the TOP Operator?” My friends, the answer is “Still more!” Today, let’s go over an option that can be used in conjunction with TOP. That option is SET ROWCOUNT (Number); This option has the potential to…… Continue reading Not Quite To the Top
Tag: SQLQuestions
There Has to be Room at the TOP!
In our continuing adventures with the TOP operator in SQL, we’ve seen it do a lot of things that probably aren’t obvious when you first think about using TOP – especially if you’ve been using SQL for a while. Let’s say that our wonderful Product team asks us to get the top 1 % of…… Continue reading There Has to be Room at the TOP!
What to do with TOP when there are ties
In the last few blog posts – see here and here – we’ve been discussing the usage of the TOP operator. The product team will often ask for the top 5 of something or even the top 10% of performers in a subregion. There’s an additional part to the TOP operator that you won’t see…… Continue reading What to do with TOP when there are ties
Getting the TOP Performers
In the last blog post, we went over the extreme basics of using the TOP operator in SQL. We showed how to grab things like the TOP 10 of a certain item. That ability will get you through a number of criteria that you will be asked to perform. But what if you’re asked to…… Continue reading Getting the TOP Performers
TOP of the Mornin’ to You!
Sometimes you find yourself stuck in a rut and you never even know that there is a rut. That’s where I found myself today my friends! For years – and I do mean years – when I’ve been asked for the first 10 rows from a query, I would do the following: SELECT TOP 10…… Continue reading TOP of the Mornin’ to You!
Wrapping Everything Up Importing and Exporting
When we think of importing and exporting data into SQL Server, whether it be from Excel spreadsheets or some other source, we do have to be careful. If we want to import data into a Production system – this is probably a bad idea period. If proper monitoring is happening on the server, someone will…… Continue reading Wrapping Everything Up Importing and Exporting
Windowing Functions Exercises
So, using the Lahman’s baseball database – found here – let’s go thru some practice exercises to try out your new windowing functions skills: Find the first year that each park was played inShow the rank with ties (both ways) of the games started in 1983 for each league for all playersPlace the players into…… Continue reading Windowing Functions Exercises