Viewing 15 posts - 4,591 through 4,605 (of 5,504 total)
Here's what I would use.
;with cteTally AS
(
SELECT row_number() OVER(order BY v1.number) AS N FROM master..spt_values v1
WHERE type ='P' AND number<365
),
cteCalendar AS
(
SELECT dateadd(dd,N-1,'20100101') AS day_
FROM cteTally
)
,cteHrPerDay AS
(
SELECT dateadd(hh,N-1,day_)...
January 5, 2010 at 5:27 pm
I didn't question Phils solution as "having a problem"...
I might have misinterpreted / overreacted though.
Probably caused by some bad private news I received shortly before... Shouldn't have posted in that...
January 5, 2010 at 2:30 pm
GilaMonster (1/5/2010)
...And now on SQLTeam as well: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=137926 Just in case.
Oh, it was posted 3 weeks ago there too. http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=137201
With lots of assistance from lots of people.
It seems like Gus...
January 5, 2010 at 2:21 pm
That's a slightly different requirement...
What I would do is to start with a calendar table holding days and hours.
Then I would use this table in a left join on Watts_Hour...
January 5, 2010 at 1:53 pm
It seems like the time to find the root cause of poor performance and the "fix" was well spent!
Glad I could help! 😀
January 5, 2010 at 1:40 pm
Alvin Ramard (1/5/2010)
Lynn Pettis (1/5/2010)
CirquedeSQLeil (1/5/2010)
Lynn Pettis (1/5/2010)
CirquedeSQLeil (1/5/2010)
...
Actually, nothing earlier indicated that it was urgent, so more like ...
I have a problem:
http://www.sqlservercentral.com/Forums/Topic834653-338-1.aspx
And then, three weeks later, I am going...
January 5, 2010 at 1:32 pm
kramaswamy (1/5/2010)
Oh, neat. So I can do this instead:...
To have it use "url" as the root, instead of having no root. Nice!
Yeap.
It's the same like it is for any...
January 5, 2010 at 1:16 pm
kramaswamy (1/5/2010)
Can you explain to me how this is working? I'm a bit fuzzy on the...
January 5, 2010 at 11:57 am
kramaswamy (1/5/2010)
So, yeah, they are storing a ton of...
January 5, 2010 at 10:46 am
It seems like we need the OP to clarify what he's looking for...
January 5, 2010 at 10:27 am
If UNION will be used, there wouldn't be any difference whether it took the data from table 1 or table 2: both have to be identical. How would you know...
January 5, 2010 at 7:18 am
dbuendiab (1/5/2010)
January 5, 2010 at 4:16 am
winston Smith (1/5/2010)
January 5, 2010 at 4:02 am
Do you have an index on your table that is comparable to the one I would use?
And if so, are the timings taken before or after applying the index?
Important side...
January 5, 2010 at 3:30 am
What have you tried so far?
Did you check the examples in BOL (Books Online, the SQL Server help system installed together with SQL Server)?
You might want to look for "Sorting...
January 5, 2010 at 3:08 am
Viewing 15 posts - 4,591 through 4,605 (of 5,504 total)