Viewing 15 posts - 46,411 through 46,425 (of 59,062 total)
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...
December 23, 2008 at 12:14 pm
Cool... Thanks Markus.
December 23, 2008 at 12:07 pm
Luke L (12/23/2008)
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,...
December 23, 2008 at 5:59 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...
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...
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....
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....
December 23, 2008 at 5:16 am
I agree... CASE is almost as fast and bit easier to read.
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"
...
December 23, 2008 at 5:07 am
Santhosh (12/23/2008)
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
This works fine.
But the salary is not ORDERed BY ASC
It works fine for only...
December 23, 2008 at 5:04 am
vbandlamudi (12/23/2008)
Correct AnswerSelect id,name, sal, cumsal=
(select sum(t1.sal)
from employee_san t1
where t1.id <= t.id)
from employee_san t
Ummmm... No... that's NOT the correct answer. That makes a triangular join. Try...
December 23, 2008 at 5:00 am
Heh... and it works so well for these types of bitwise ops.
December 22, 2008 at 5:18 pm
Viewing 15 posts - 46,411 through 46,425 (of 59,062 total)