July 14, 2018 at 1:41 am
I’m wondering what I would need to focus and revise on if I want to improve my thinking process whilst creating a query or a stored procedure when I’m dealing with a fair amount of data. For example, I understand how to get data from various tables and using the correct join to represent data but what I’m having difficulty with is writing SQL when I have to manipulate the actual data. An example would be to get all customers who have made a complaint in the last month, now that’s easy, but getting the first occurrence of a customers complaint? The last? So instead of getting the data that actually exists I’m talking about the thought process of using the existing data to get the desired result. I’ve heard of CTE’s, I’ve heard of temp tables/sets etc. So what would be a recommended way to get a good grip on all this, and if somebody could point me to a suitable training tutorial I'd appreciate it. Thanks.
July 15, 2018 at 8:24 am
It's certainly not a panacea but there is a thought process that helped me immensely. So much so that I added to my signature line below years ago. That and the understand that, as sophisticated as it is, SQL Server is basically a file handler and things like a SELECT are basically a loop (cursor) that's executed at near machine language levels behind the scenes (I refer to such loops as a "Pseudo Cursor", which is the term for such things first coined by R. Barry Young on these very forums).
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply