Viewing 11 posts - 1 through 11 (of 11 total)
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 seconds...
December 23, 2008 at 5:26 am
Select id,name, sal, cumsal=
(select sum(t1.sal)
from employee_san t1
where t1.id <= t.id)
from employee_san t
December 23, 2008 at 4:24 am
Select id,name, sal, cumsal=
(select sum(t1.sal)
from employee_san t1
where t1.id <= t.id)
from employee_san t
December 23, 2008 at 4:23 am
Correct Answer
Select id,name, sal, cumsal=
(select sum(t1.sal)
from employee_san t1
where t1.id <= t.id)
from employee_san t
December 23, 2008 at 4:21 am
update #student set studentpassstatus=
case when (select max(passstatus) from #subject where #student.studentid=#subject.studentid)='Y' then 'PASS' else 'FAIL' end
November 14, 2008 at 12:13 am
create table #tmp
(id varchar(10))
insert into #tmp
select '10.10'
union select '3010'
union select '20.20'
union select '4020'
union select '14020'
union select '1402'
update #tmp set id=substring(id,1,len(id)-2)+'.'+substring(id,len(id)-1,len(id)) where id not like '%.%'
November 13, 2008 at 10:44 pm
please check this...
this is giving both the rows
select temp1.location,temp1.number,(temp1.qty1-temp2.qty2)as Total from
(select location,number,sum(quantity)as qty1 from test1
group by Number,location) temp1,
(select sum(quantity)as qty2 from test11
where param1>0 and param2='Ord'
group by Number,location) temp2
November 11, 2008 at 5:50 am
please check this out:
my data is like as folows
order_num prdo_grp ...
August 27, 2008 at 11:19 pm
Thanking you very much.
August 27, 2008 at 5:59 am
it works fine. thanking you very much
August 27, 2008 at 5:38 am
i do not need any group by /sum values here. can you provide me a simple pivot query based on my input
August 27, 2008 at 12:05 am
Viewing 11 posts - 1 through 11 (of 11 total)