Viewing 15 posts - 46,441 through 46,455 (of 59,095 total)
JohnG (12/23/2008)
Jeff Moden (12/22/2008)
Here's a real cheater method...
SELECT SIGN(SUM(Col1+0)), SIGN(SUM(Col2+0)), SIGN(SUM(Col3+0))FROM SomeTable
That only works for the first bit. I have a similar problem where...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 5:33 pm
Heh... dunno why we're pussy footin' around it... :hehe: if you don't already have a Tally table, now would be a good time to build one. To find out...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 5:21 pm
Jack Corbett (12/23/2008)
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 12:43 pm
I agree with Jack... we could make the query lookup a bit faster but it would only be by milliseconds for each query. Unless you understand the business rules...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 12:14 pm
Cool... Thanks Markus.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 12:07 pm
Can you say "Matrix" boys and girls?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 12:01 pm
Luke L (12/23/2008)
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 6:16 am
r.hensbergen (12/23/2008)
Please read the following for answers to these questions...
[font="Arial Black"]Solving the "Running Total" & "Ordinal Rank" Problems in SS 2k/2k5[/font][/url]
I'm still too attached to my VB way of thinking,...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 5:59 am
OH! THE IRONY! 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 5:46 am
vbandlamudi (12/23/2008)
--------------------------------------------------------------------------------
Correct Answer
Select id,name, sal, cumsal=
(select sum(t1.sal)
from employee_san t1
where t1.id <= t.id)
from employee_san t
the above query took 16 seconds to process 27170 rows
and it took 51...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 5:42 am
I agree... tell us what the rest of the problem is and maybe use the link in my signature to find out how to post some test data. There's...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 5:27 am
Steve Jones - Editor (12/22/2008)
Indeed, my guess is Jeff if handcrafting something right now in the winter snows of MI.
Heh... just waiting for the specs on the 23 character password/pin....
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 5:18 am
peter (12/23/2008)
Jeff is quiet about my posts - too quiet....is a storm coming?LOL
Nah... not ignoring you, Peter. Functions do normally contain some unneccessary overhead. Normally... there are exceptions....
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 5:16 am
I agree... CASE is almost as fast and bit easier to read.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 5:11 am
r.hensbergen (12/23/2008)
UPDATE #Results
SET @PrevCum_Sal = Cum_Sal = Sal + @PrevCum_Sal,
@PrevName = Name --Just an "anchor"
...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 23, 2008 at 5:07 am
Viewing 15 posts - 46,441 through 46,455 (of 59,095 total)