Rivandra,

The minus operator is a set operator. It subtracts one
result set from another. That is, the rows from the second
result set that exist in the first result set are removed from
the first result set, and the remaining rows are returned.

To substract one sql numeric result from another, use
sqlplus variables.

col a new_value a_hold
select 15 a from dual;

-- a_hold now contains 15

select 25 - &a_hold from dual;

will provide the desired result.

hth,

Yosi


Ravindra Basavaraja wrote:

> I am writing a SQL query using the MINUS operator.Both the select statements
> return a number result and I
> am trying to get the o/p with the difference of both the queries using the
> MINUS
> between the two select statements.But I am getting the o/p of the first
> query only
> and the displayed result is not the subtracted value.Both select statements
> give
> different number o/p when run individually.What could be wrong.
>
> Is there anything that i am missing to consider when using the MINUS
> operator.
>
> Pls help
>
> Thanks
> Ravindra
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Ravindra Basavaraja
>   INET: [EMAIL PROTECTED]
>
> 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: [EMAIL PROTECTED] (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).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Yosi Greenfield
  INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to