GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  KPIT
Go To First  |  Previous Question  |  
 KPIT  |  Question 2 of 2    Print  
In the emp table :
>
> EMPNO ENAME SAL
> ==================
> 7369 SMITH 1000
> 7499 ALLEN 2000
> 7521 WARD 3000
> 7566 JONES 4000
> 7654 MARTIN 5000
>
> there is a requirement to have a calculated col.
> called cummulative sal
>
> EMPNO ENAME SAL CUMMULATIVE_SAL
> 7369 SMITH 1000 1000
> 7499 ALLEN 2000 3000
> 7521 WARD 3000 6000
> 7566 JONES 4000 10000
> 7654 MARTIN 5000 15000
>
> How to show this calculated col. by using one
> select statement?

  
Total Answers and Comments: 2 Last Update: June 08, 2006     Asked by: Chinmoy 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 09, 2006 01:10:58   #1  
Suraj Marathe        

RE: In the emp table :> > EMPNO ENAME...

select empno ename sal (select sum(sal) from emp e1 where e1.rowid< e.rowid) COMMULATIVE_SAL from emp e


 
Is this answer useful? Yes | No
June 08, 2006 08:52:45   #2  
sunil        

RE: In the emp table :> > EMPNO ENAME...
select empno ename sal sum(sal)
over(order by empno ) cum_sal
from emp

 
Is this answer useful? Yes | No

 Related Questions

In the emp table :> > EMPNO ENAME SAL > ==================> 7369 SMITH 1000 > 7499 ALLEN 2000 > 7521 WARD 3000 > 7566 JONES 4000 > 7654 MARTIN 5000> > there is a requirement to have a calculated col.> called cummulative sal> > EMPNO ENAME SAL CUMMULATIVE_SAL> 7369 SMITH 1000 1000> 7499 ALLEN 2000 3000> 7521 WARD 3000 6000> 7566 JONES 4000 10000> 7654
Read Answers (2) | Asked by : Chinmoy


 Sponsored Links

 
Related Articles

ODP.NET - Populating a Dataset with a Single Data Table

ODP NET Populating a Dataset with a Single Data Table A dataset is simply a group of data tables These data tables can be identified with their own unique names within a dataset You can also add relations between data tables available in a dataset mosgoogle The following code gives you the details o
 

jQuery Table Row Finished Code

jQuery Table Row Finished Code The Finished Code Our second example page has demonstrated table row striping highlighting tooltips collapsing expanding and filtering Taken together the JavaScript code for this page is mosgoogle geshibot lang php&quot; document ready function var highlighted
 

jQuery Expanding and Collapsing Table Rows

jQuery Expanding and Collapsing Table Rows The expanding and collapsing behavior added earlier also conflicts with our filters If a section is collapsed and a new filter is chosen then the matching items are displayed even if in the collapsed section Conversely if the table is filtered and a section
 

jQuery Table Row Filtering

jQuery Table Row Filtering Earlier we examined sorting and paging as techniques for helping users focus on relevant portions of a table s data We saw that both could be implemented either with server side technology or with JavaScript Filtering completes this arsenal of data arrangement strategies B
 

jQuery Collapsing and Expanding Table Rows

jQuery Collapsing and Expanding Table Rows When large sets of data are grouped in tables as each year s set of articles are in our News page collapsing or hiding a section s contents can be a convenient way to get a broad view of all of the table s data without having to scroll so much mosgoogle To
 

jQuery Table Manipulation

Learning jQuery Table Manipulation By Karl Swedberg Jonathan Chaffer Better Interaction Design and Web Development with Simple JavaScript Techniques Learning jQuery packtpub com jQuery book Table Manipulation Let em wear gaudy colors Or avoid display Devo Wiggly World&quot; In the first si
 

What are the limitations with switch statement?

Switch statement is a powerful statement used to handle many alternatives and provides good presentation for C program. But there are some limitations with switch statement which are given below: Logical operators cannot be used with switch statement. For instance case k&gt;=20: is not allowe
 

goto Statement

Why to avoid goto in C C has goto statement but one must ensure not to use too much of goto statement in their program because its functionality is limited and it is only recommended as a last resort if structured solutions are much more complicated. First let us understand the goto statement, its
 

SQL Table Commands

SQL Table Commands Overview As mentioned previously in this series of SQL articles, databases are primarily composed of tables. The &ldquo;columns and rows&rdquo; structure of the table allows data to be efficiently inserted, manipulated, updated, and deleted from the database. The three mos
 

How To Select The Best CRM Solution For Your Business

How To Select The Best CRM Solution For Your Business When most people talk about Customer relationship management they use the term in a context that is connected to large corporations However the costs of CRM systems have continued to fall in the last few years and it is now in the price range of
 

Related Categories
Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape