Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Substraction SQL query
Hi DBAs,
I've another issue like my previous one.
my date format is 'HH:MI:SS DAY DD-MON-YYYY'
SQL>select * from j_transaction_log ;
TRANS_COUNT CHECKED_TIMESTAMP
----------- ---------------------------------------- 2150 01:13:47 FRIDAY 26-JUL-2002 2162 01:15:01 FRIDAY 26-JUL-2002 2170 01:16:27 FRIDAY 26-JUL-2002How to write in sql statment to get the result like below on column TRANS_COUNT?
----------- ---------------------------------------- 0 01:13:47 FRIDAY 26-JUL-2002 12 01:15:01 FRIDAY 26-JUL-2002 8 01:16:27 FRIDAY 26-JUL-2002Once again thanks in advance for your help. Regards,
cosltemp-g.manoj_at_orbitech.co.in wrote: Alternative Solutn
select a.s_month,a.s_sum - b.s_sum
from x_test a,x_test b
where to_date(a.s_month,'MON') = add_months(to_date(b.s_month,'MON'),1)
or rownum = 1
-----Original Message-----
Sent: Friday, July 26, 2002 3:13 PM
To: ORACLE-L
Cc: jonny99delmont
<< File: sql query on substract.HTM >>
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 Fri Jul 26 2002 - 08:43:22 CDT