Viewing 15 posts - 3,346 through 3,360 (of 5,504 total)
Sounds like homework to me...
Anyway... you need to perform an outer self-join based on ID=ID+1.
Use the CASE statement to take care of NULL values and different years.
If those
Give it...
June 10, 2010 at 1:03 pm
I assume you need a dynamic solution to cover "flexible" date ranges.
In this case I'd recommend you start with reading the "crossTab" article refernced in my signature followed by the...
June 10, 2010 at 12:37 pm
Do you want to have the result set as one column with separator or do you want one column per date?
Edit: and why do you need to do it on...
June 10, 2010 at 12:11 pm
Two minor fixes: 1) remove the namespace declaration since this is an untyped xml document and 2) remove the "/PROVIDER" from your nodes declaration since this tag is closed before.
--;WITH...
June 10, 2010 at 9:41 am
mzak (6/8/2010)
External environment aside...
If you're concerned about INSERT performance only, adding indexes will cause more writes to occur which has the potential to slow down INSERTs (depends on if your...
June 8, 2010 at 3:19 pm
To follow tosscrosby's concern:
What would be your expected output for the following sample data? And Why?
INSERT @Sample (PersonID, Month) VALUES (11,'06');
INSERT @Sample (PersonID, Month) VALUES (11,'08');
INSERT @Sample...
June 8, 2010 at 2:49 pm
I probably would use a CTE to calculate the sum using a case condition like you did. I think the execution plan will be the same but it's easier to...
June 8, 2010 at 1:40 pm
You could use the FOR XML PATH string concatenation.
For a list of examples, please search this site for "string concatenation xml".
Side note: with 90 visits I'd expect you did run...
June 8, 2010 at 1:33 pm
and here's the same approach, just without using intermediate tables (I'm using subqueries, or CTE's):
Side note (valid for both solutions provided so far): Those solution will only work if you...
June 7, 2010 at 3:10 pm
But whatever you do, keep in mind that someone with sa privileges might still be able to change permissions without leaving a trace (or at least with a trace that's...
June 7, 2010 at 12:45 pm
Thank you for clarification, Gregory! (I shuddered for a moment or two... :hehe: )
Glad it did save "a minute or two" 😀
It was a real pleasure working with you. Come...
June 7, 2010 at 12:12 pm
gregory.anderson (6/7/2010)
June 7, 2010 at 11:58 am
Hi Gregory,
any news regarding the performance on the production hardware?
June 6, 2010 at 4:28 pm
@jeff: I'm confused...
When talking about the double row_number approach I was referring to the sample code I provided a few posts back (not the "deep dive" approach though).
It's showing a...
June 6, 2010 at 3:54 pm
Viewing 15 posts - 3,346 through 3,360 (of 5,504 total)