Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Substraction SQL query

RE: Substraction SQL query

From: Jonny Delmont <jonny99delmont_at_yahoo.co.uk>
Date: Mon, 29 Jul 2002 02:38:26 -0800
Message-ID: <F001.004A460F.20020729023826@fatcity.com>

Hi Manoj,
Again thanks a lot for your help!
Regards,
Jonny
  cosltemp-g.manoj_at_orbitech.co.in wrote: i/p data



table : x_test

s_sum timestamp

2150 7/26/02 1:13:47 AM 
2162 7/26/02 1:15:01 AM
2170 7/26/02 1:16:27 AM
2200 7/26/02 1:20:34 AM 

Solution :


select a.s_sum - b.s_sum s_sum,a.timestamp from x_test a,x_test b
where (a.s_sum > b.s_sum)
and b.s_sum =
(

select max(s_sum)
from x_test
where s_sum < a.s_sum
)
or rownum = 1

o/p data :


s_sum timestamp

0 7/26/02 1:13:47 AM
12 7/26/02 1:15:01 AM
8 7/26/02 1:16:27 AM
30 7/26/02 1:20:34 AM

-----Original Message-----
Sent: Friday, July 26, 2002 7:13 PM
To: ORACLE-L
Cc: jonny99delmont

<< File: Substraction SQL query.HTM >>



Get a bigger mailbox -- choose a size that fits your needs.

http://uk.docs.yahoo.com/mail_storage.html

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: =?iso-8859-1?q?Jonny=20Delmont?=
  INET: jonny99delmont_at_yahoo.co.uk

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Mon Jul 29 2002 - 05:38:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US