473,387 Members | 1,897 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Selection Values From 2 Different Rows Of Same Query For Further Calculations

COSIDER THE DATA

Year Grade TOT SAL
--------- -------------- ---------- -
SAM G dIAS
-------------------------------------
2003 X1 2964.00 3041.08

2004 SS 4125.00 4291.67
2005 SS 4275.00 4441.67
2006 SS 4725.00 4891.67
2007 SS 6664.00 7289.0
2008 SS 7339.00 7964.00
--------- -------------- ---------- -
LISA G dIAS
-------------------------------------
2003 X1 2964.00 3041.08

2004 SS 4125.00 4291.67
2005 SS 4275.00 4441.67
2006 SS 4725.00 4891.67
2007 SS 6664.00 7289.0
2008 SS 7339.00 7964.00
--------- -------------- ---------- -
ANNA dIAS
-------------------------------------
2003 X1 2964.00 3041.08

2004 SS 4125.00 4291.67
2005 SS 4275.00 4441.67
2006 SS 4725.00 4891.67
2007 SS 6664.00 7289.0
2008 SS 7339.00 7964.00

IS RESULT FROM THE 1 QUERY QUERY
NO I WANT THE DIFFERENCE BETWEEN SAL OF 2007 AND 2008 HOW TO DO?
May 17 '07 #1
3 1328
debasisdas
8,127 Expert 4TB
Since u have put a question in article section i am moving it to oracle forum.
May 18 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
Post the SQL of the query you are currently using to retrieve this data.
May 19 '07 #3
HOPE IT WORKS....

SELECT T1.YEAR,T1.GREADE,T1.SAL,
LAG(T1.SAL,1) OVER (ORDER BY YEAR) PREV_SAL,
T1.SAL-( LAG(T1.SAL,1) OVER (ORDER BY YEAR) ) SAL_DIFRNCE
FROM T1 WHERE T1.YEAR=2008

do post if any doubt is there....
May 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: middletree | last post by:
Posted this to Access group, meant to do it here: I have what I call a composite table. Can't recall what they called it in database class, but it's where you take the PK of two different...
7
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals....
1
by: Tom G | last post by:
Hello, I need some advice on which way to resolve the following. On a form, the user will make a selection from a combo box, after the selection several different fields need to be updated on...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
0
by: Jeff Boes | last post by:
I hope this helps someone else ... I had struggled some time ago with attempts to get a rank of values query to work, but then I gave up and set it aside. I had another reason to attack it, and in...
12
by: John | last post by:
Hi How can I select records that have non-alphanumeric characters in a field using a select query? Thanks Regards
6
by: shira | last post by:
Hi, Looking to see if someone might have an explanation for this behavior. Is it a bug? Corruption? I have been able to reproduce the problem with only 2 rows and 1 field. Here is the table:...
7
by: google | last post by:
I am trying to automate the way reports are printed in an Access 2003 database - I have ~200 records (people) who require between 5 and 10 customized reports (depending on values within certain...
87
by: pereges | last post by:
I have a C program which I created on Windows machine. I have compiled and executed the program on windows machine and it gives me the consistent output every time i run it. for eg. input a = 2,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.