To_char(adate,'dd.mm.yyyy')   returns different results  from  two oracle clients !!! Is it  possible?

Dear all;
We have only one Database server with some IIS's   as web servers on front . Each web server has own oracle client software in order connect to central database..
The same following query used in C#  code  returns different results on each IIS server.(3 row, or  not data found )
why?
select     *    from    aTable    where        to_char( adate ,  'dd.mm.yyyy' )  =   :search_date
regards
Siya

1006237 wrote:
If adate is of DATE datatype, it will most likely has the time component. Therefore your SQL below is unlikely to return any data.
select * from aTable where adate = to_date(:search_date, 'dd.mm.yyyy')
Perhaps.....
select * from aTable where TRUNC(adate) = to_date(:search_date, 'dd.mm.yyyy')
Hi,
not having any sample data from you I could not understand that you wanted to select the range 00:00:00 - 23:59:59 on search_date.
Your method might not be efficient if you have an index on adate.
Maybe something like this will be more efficient
select * from aTable
where adate >= to_date(:search_date, 'dd.mm.yyyy')
  and adate <  to_date(:search_date, 'dd.mm.yyyy') + 1;
If you search_date is 30-Aug-2013 it will get records where adate >= 30-Aug-2013 00:00:00 and adate < 31-Aug-2013 00:00:00, so any time of date 30-Aug-2013.
Try like this and let us know if you still have 2 different results.
Regards.
Alberto

Similar Messages

  • Select statement returns different results from 9i and 10g

    Hi all,
    Would appreciate if someone could help to solve this puzzle here:
    I have the exact the statements running on Oracle 9i and 10g, why do they return different results?
    Select unique(GroupDesc) , GroupSeq from Module where ModuleId in (Select ModuleId from User_Access where UserId='admin') and Status='A'
    In Oracle 9i:
    Both columns returned as follows...
    GroupDesc | GroupSeq
    In Oracle 10g:
    Only one column returned, the column with unique keyword was missing...
    GroupSeq
    Could anyone enlighten me?

    yes, the table structure... actually the CREATE TABLE statement...
    with some sample data (INSERT INTO)
    and the actual queries (both of them - copy-paste them from each separate environment)
    you can use tags around the statements this will format it to a fixed font - making it easier to read
    Edited by: Alex Nuijten on Feb 20, 2009 10:05 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • 0PA_C01  different results from two queries on the same cube ....

    HI
    Can you please help with this  problems ...
    i am running a two queries with the same restrictions e.g
    Sep 08 for employee 22345 ,
    In one report it shows the Pay Scale level as A1 , then in the other report it shows Pay scale Scale level as A2  ,
    looking  at the master data in 0employee  , the first report is right ... this is how the data looks like in 0employee
    Employee  Valid from      To                Pay scale Level
    222345       2007-11-03   2008-09-30     A1
    222345       2008-10-01   9999-12-31     A2
    Can someone please shed some light on this , im thinking it has something to do with update rule but even that is supposed to use last date of the month , not 1st day of the following month. The Cube is a stndard cube 0PA_C01 and the update rule aswell .....

    Hi,
    Please check in the cube whether the data for the Employee is getting with two values like shown in your question:
    Employee Valid from To Pay scale Level
    222345 2007-11-03 2008-09-30 A1
    222345 2008-10-01 9999-12-31 A2
    and also check whether when the data loaded to the cube.
    There may be some change in the report structure where the difference is getting may in the column wise or row wise restriction may present.
    Please check on the structure of the report also.
    With Regards,
    Ravi Kanth

  • "select count(*)" and "select single *" returns different result

    Good day!
    product version SAP ECC 6.0
    oracle10
    data transfers from external oracle db into customer tables using direct oracle db link
    sometimes I get case with different results from 2 statements
    *mytable has 10 rows
    *1st statement
    data: cnt type I value 0.
    select count( * ) into cnt from mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *cnt returns 10 - correct
    *2nd statement
    select single * from  mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *sy-dbcnt returns 0
    *sy-subrc returns 4 - incorrect, 10 rows are "invisible"
    but
    1. se16 shows correct row number
    2. I update just one row from "invisible" rows using se16 and 2nd statement returns correct result after that
    can not understand why
    thank you in advance.

    Thank you, Vishal
    but,
    general problem is that
    1. both statements have the same WHERE conditions
    2. 1st return resultset with data (sy-dbcnt=10), 2nd return empty dataset, but must return 1 in sy-dbcnt
    Yes, different meaning, you are right, but must 2nd must return 1, because of "select single *" construction, not 0.
    Dataset to process is the same, WHERE conditions are equal...
    I think the problem is that how ABAP interperets select count(*) and "select single *".
    Maybe "select count (*)" scans only PK from index page(s)? and "select single *" scans data pages? and something is wrong with that?
    I'm new in SAP and didn't find any SAP tool to trace dump of data and indexes pages with Native SQL.
    se16 shows all records.
    And why after simple manual update of just one record using se16 "select single *" returns 1?
    I've just marked one row to update, didn't change any data, then pressed "save".

  • Returning Different Results Based on Input Criteria

    I have a complex nested select statement. Based on selection criteria I want to return different results. Say for instance I had an input parameter Called Products which could contain a Yes/No Flag. If the Flag was Yes then I would want the "top" select, statement to be The following:
    Select Product, Time_ID, Amt
    From
    My Complex Nested Select
    But if Product was set to "No", I would want the following:
    Select Time_ID, Amt
    From
    My Complex Nested Select
    I know, or course that I can have two COMPLETE set of SQL which are invoked based upon testing the value of the PRODUCT Parameter, but If I duplicate the "inner nested select" then I have 2 sets of select staments to maintain. Is there an alternative to this? Could I make the inner portion which does not change a function of some sort so that my code would look something like this?
    Select Product, Time_ID, Amt
    From
    Execute myNestedSelectFunction
    But if Product was set to "No", I would want the following:
    Select Time_ID, Amt
    From
    Execute myNestedSelectFunction
    This would atleast ensure that I only have to go one place to maintain the logic of the "static Nested Select" statement.
    Just want to make sure I do not have a real viable alternative to "duplicating code"
    Thanks

    Hi,
    Look in TFM for PIPELINED functions which will allow you to:SELECT Product, Time_ID, Amt FROM TABLE(myPipelinedFunctionReturningSelectResult()) T;
    SELECT Time_ID, Amt FROM TABLE(myPipelinedFunctionReturningSelectResult()) T;There are samples if you look on AskTom too.
    Regards,
    Yoann.

  • Why do I get two different results from the same coefficients?

    I am getting two different results from the Polynomial Evaluation function.
    For the first one, I am getting the coefficients from a Polynomial Fit function.  I feed the coefficients from the Fit function into the Poly Eval function and get the correct result of 12.8582 when I evaluate 49940.
    For the second one, I create constant array of the SAME values that were returned from the Polynomial Fit function (i typed them in).  However, I am getting an incorrect result of -120.7913 when I feed the constant array into the Poly Eval function when I evauate 49940.
    How can this happen when I am using the same array values?
    Attached is an image of what I am explaining.
    Solved!
    Go to Solution.
    Attachments:
    polynomial_evaluation.jpg ‏213 KB

    Hi Altran,
    are you sure about using the "same" coefficients?
    Did you compare them? Did you (atleast) set the display properties to 17 significant digits?
    Please attach a VI instead of a picture...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Different Results From V$Rman_Backup_job_details  and V$Rman_Status

    Does anyone know why I would get different results from V$Rman_Backup_job_details and V$Rman_Status on the same instance?
    Image of Quries: www.hydell.com/OracleBackupDifferences.png
    Dates Returned For Latest Backup
    V$Rman_Status = 10/13/2011
    V$Rman_Backup_job_details = 7/24/2011
    Which view is the best to use for monitoring backups?
    Thanks in advance for the help.
    Rob

    oracle.dba.89 wrote:
    Please show the script and that might help look into this. Also the timezone of the OS shows EST. And cron shows the scheduled time at 12hrs. It should run at 12:00 EST hours and not GMT.
    Also please post output for below queries. Are backups run from the same node? (If RAC)
    select value from dba_scheduler_global_attribute where attribute_name = 'DEFAULT_TIMEZONE';
    Hi,
    This is the backup script
    #Set Variables
    ORACLE_HOME=/projects1/oramroprod/oracle/product/10.2.0/db_4
    ORACLE_SID=MROPROD
    PATH=$PATH:$ORACLE_HOME/bin
    btype="FULL"
    RMAN_BACKUP_LOC=/data1/RMAN/MROPROD
    export ORACLE_HOME
    export ORACLE_SID
    export PATH
    export btype
    tag="$ORACLE_SID"_"$btype"
    #Print commands and their arguments as they are executed
    set -x
    SDATE=`date +%m%d%y`
    STIME=`date +%H%M%S`
    DD=`date +%d%m%y`
    #Create daily backup directories
    mkdir -p $RMAN_BACKUP_LOC/datafiles_backup/bkp_${DD}
    mkdir -p $RMAN_BACKUP_LOC/controlfile_backup/bkp_${DD}
    mkdir -p $RMAN_BACKUP_LOC/arch_backup/bkp_${DD}
    mkdir $RMAN_BACKUP_LOC/logs
    #Take backup
    rman target / nocatalog log=$RMAN_BACKUP_LOC/logs/rman_${btype}_backup_${SDATE}_${STIME}.log << EOF1
    change archivelog all crosscheck;
    run {
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
    CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
    backup as compressed backupset incremental level 0 database tag '$tag' format '$RMAN_BACKUP_LOC/datafiles_backup/bkp_${DD}/%d_%s_%p';
    backup as compressed backupset archivelog all not backed up 1 times FORMAT '$RMAN_BACKUP_LOC/arch_backup/bkp_${DD}/ARCH_%d_%s_%p';
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO  '$RMAN_BACKUP_LOC/controlfile_backup/bkp_${DD}/%F';
    delete noprompt obsolete;
    delete noprompt archivelog all completed before 'sysdate-2';
    EXIT;
    EOF1
    This is not RAC.
    SQL> select value from dba_scheduler_global_attribute where attribute_name = 'DEFAULT_TIMEZONE';
    VALUE
    GMT

  • Different results from all_objects

    Can someone please explain me,
    How it is possible to get different results from "all_objects", once I query it from "SQL Worksheet" and next time when I execute the procedure with the same query ?
    The procedure is created by schema user (owner) and it's executed by it.
    Same as the query.
    I am querying for objects which belongs to other owners.
    Is there a way how to trace which privileges are used for querying the "all_objects" ?
    Any hint will be very welcomed ?

    You are correct, sorry.
    Oracle 11g EE 11.2.0.1.0 - 64bit Production on Windows 2K8
    I already lost my whole day, probably I will lost the weekend, too.
    Here is the sample code:
    CREATE OR REPLACE PROCEDURE PROCEDURE1 AS
    BEGIN
    FOR c IN (SELECT object_name from all_objects d
    WHERE d.owner IN ('DWH_CM')
    LOOP
    dbms_output.put_line(c.object_name);
    end loop;
    END PROCEDURE1;
    Test
    exec procedure1;
    -- does not write anything in output and it is enabled
    select object_name
    from all_objects O
    WHERE o.owner IN ('DWH_CM');
    -- returns 99 rows
    Edited by: user9377205 on Aug 6, 2010 9:06 AM

  • Sum two different columns from two different tables

    Can you select and sum two different columns, from two different tables in the same sql statement?
    i.e.
    table1
    Item----OnHand_Qty
    A--------10
    A--------15
    B--------10
    B--------10
    C--------20
    table2
    Item----Trx_Qty
    A--------2
    A--------4
    A--------6
    B--------1
    B--------1
    C--------4
    I'm looking for the following results from a query
    Item----Sum(Onhand_Qty)---Sum(Trx_Qty)
    A--------25

    Like this?
    SQL> create table table1 (item,onhand_qty)
      2  as
      3  select 'A', 10 from dual union all
      4  select 'A', 15 from dual union all
      5  select 'B', 10 from dual union all
      6  select 'B', 10 from dual union all
      7  select 'C', 20 from dual union all
      8  select 'D', 30 from dual
      9  /
    Tabel is aangemaakt.
    SQL> create table table2 (item, trx_qty)
      2  as
      3  select 'A', 2 from dual union all
      4  select 'A', 4 from dual union all
      5  select 'A', 6 from dual union all
      6  select 'B', 1 from dual union all
      7  select 'B', 1 from dual union all
      8  select 'C', 4 from dual union all
      9  select 'E', 3 from dual
    10  /
    Tabel is aangemaakt.
    SQL> select nvl(t1.item,t2.item) item
      2       , t1.sum_onhand_qty
      3       , t2.sum_trx_qty
      4    from ( select item, sum(onhand_qty) sum_onhand_qty
      5             from table1
      6            group by item
      7         ) t1
      8         full outer join
      9         ( select item, sum(trx_qty) sum_trx_qty
    10             from table2
    11            group by item
    12         ) t2
    13         on (t1.item = t2.item)
    14  /
    I SUM_ONHAND_QTY SUM_TRX_QTY
    A             25          12
    B             20           2
    C             20           4
    E                          3
    D             30
    5 rijen zijn geselecteerd.Regards,
    Rob.

  • Oracle function and query return different results

    Hi, I am using oracle 10g database.
    Function is :
    create or replace FUNCTION FUNC_FAAL(myCode number,firstDate date
    *, secondDate date)*
    RETURN INTEGER as
    rtr integer;
    BEGIN
    select count() into rtr*
    from myschema.my_table tbl where tbl.myDateColumn between firstDate and
    secondDate and tbl.kkct is null and tbl.myNumberColumn  = myCode ;
    return (rtr);
    END FUNC_FAAL;
    This function returns 117177 as result.
    But if I run same query in the function seperately ;
    select count()*
    from myschema.my_table tbl
    where tbl.myDateColumn between firstDate and secondDate
    and tbl.kkct is null and tbl.myNumberColumn  = myCode ;
    I get different result 11344 (which is the right one).
    Table and function are in the same schema.
    What can be the problem ?
    Thanks.

    1. i think ur parameter name and Column names are same Firstdate and seconddate try to choose different name
    2. try using Trunc function around your dates
    where trunc(tbl.myDateColumn) between trunc(firstDate) and trunc(secondDate)then compare the result....sometimes time elements comes into play.
    Baig
    [My Oracle Blog|http://baigsorcl.blogspot.com/]

  • Same Query returning different result (Different execution plan)

    Hi all,
    To day i have discovered a strange thing: a query that return a different result when using a different execution plan.
    The query :
    SELECT  *
      FROM schema.table@database a
    WHERE     column1 IN ('3')
           AND column2 = '101'
           AND EXISTS
                  (SELECT null
                     FROM schema.table2 c
                    WHERE a.column3 = SUBSTR (c.column1, 2, 12));where schema.table@database is a remote table.
    when executed with the hint /*+ ordered use_nl(a c) */ these query return no result and its execution plan is :
    Rows     Row Source Operation
          0  NESTED LOOPS  (cr=31 r=0 w=0 time=4894659 us)
       4323   SORT UNIQUE (cr=31 r=0 w=0 time=50835 us)
       4336    TABLE ACCESS FULL TABLE2 (cr=31 r=0 w=0 time=7607 us)
          0   REMOTE  (cr=0 r=0 w=0 time=130536 us)When i changed the execution plan with the hint /*+ use_hash(c a) */
    Rows     Row Source Operation
       3702  HASH JOIN SEMI (cr=35 r=0 w=0 time=497839 us)
      22556   REMOTE  (cr=0 r=0 w=0 time=401176 us)
       4336   TABLE ACCESS FULL TABLE2 (cr=35 r=0 w=0 time=7709 us)It seem that when the execution plan have changed the remote query return no result.
    It'is a bug or i have missed somthing ?
    PS: The two table are no subject to insert or update statement.
    Oracle version : 9.2.0.2.0
    System version : HP-UX v1
    Thanks.

    H.Mahmoud wrote:
    Oracle version : 9.2.0.2.0
    System version : HP-UX v1Hard to say. You're using a very old and deprecated version of the database, and one that was known to contain bugs.
    9.2.0.7 was really the lowest version of 9i that was considered to be 'stable', but even so, it's old and lacking in many ways.
    Consider upgrading to the latest database version at your earliest opportunity. (or at least apply patches up to the latest 9i version before querying if there is bugs in your really low buggy version)

  • JNDI returns different results local vs. remote?

    I cannot get the Sun Application Server 8.1 to provide access to EJBs from an independant Tomcat. The server does seem to provide access to the EJB remote interfaces when the client war file is deployed within the SAS-internal web container. In trying to debug this problem, I have noticed that JNDI returns different objects in the two cases, even though the client in both cases is making a "remote" call to IIOP port 3700 to get the JNDI info!
    When run within the SunAppServer internal web container, JNDI returns objects of type:
    <package name>._<BeanName>RemoteHome_DynamicStub
    (e.g. in my case com.aa.ejb._BusinessRemoteHome_DynamicStub for a bean named "Business")
    However, when the same .war is deployed on an independant Tomcat running on the same machine, JNDI returns objects of type:
    com.sun.corba.se.impl.corba.CORBAObjectImpl
    Is this normal? Is there some way that I should be getting the DynamicStubs delivered to the remote clients?
    I wouldn't be worried about this except that the PortableRemoteObject.narrow() method returns null when I try to use it on the CORBAObjectImpl references.
    The relevant parts of my code are:
    p.put( Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory" );
    p.put( Context.PROVIDER_URL, "iiop://localhost:3700" );
    //?? Note: this works the same whether I use "localhost" or my actual IP address.
    String objName = "ejb/Business";     
    InitialContext initial = new InitialContext(p);
    out.println("<P>Looking up objName="+objName);
    Object objref = initial.lookup(objName);
    out.println("<P>objref="+objref);
    out.println("<br>objref class="+objref.getClass().getName());
    //?? When run in the SAS-internal web container, this displays:
    //?? com.aa.ejb._BusinessRemoteHome_DynamicStub
    //?? When run in a separate Tomcat, this displays:
    //?? com.sun.corba.se.impl.corba.CORBAObjectImpl
    BusinessRemoteHome home =
    (BusinessRemoteHome)PortableRemoteObject.narrow(objref,
              BusinessRemoteHome.class);
    //?? When run in the SAS-internal web container, this works correctly.
    //?? When run in a separate Tomcat, this returns null!

    Okay - a good night's sleep helped. Found the solution:
    Properties props = new Properties();
    props.setProperty(Context.PROVIDER_URL, "iiop://localhost:3700");
    props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.appserv.naming.S1ASCtxFactory");
    Context ctx = new InitialContext(props);
    Object ref = ctx.lookup("ejb/someEJB");
    etc.Hope this helps.
    Cheers
    Keith

  • Returning Different Results for the  Same Search Value

    I'm creating a word list and I'm using Lookup to find text entries in column D and return values from column A. I can manage one result based on the search criteria however I'm wondering if it's possible to return multiple entries from column A if multiple matches are found in column D:
    As you can see I'm trying to use the formula =LOOKUP("Aggression",D,A) to find all the instances of "Aggression" in column D and return all the corresponding results from column A (audacious, barefaced, and depredation). Lookup however only returns the last match (depredation).

    I wish you'd shown where your LOOKUP function is located and what you're trying to do with it. Are you going to be using these results in another function? Or are you simply wanting to display the results of your search?
    If the latter, there's an elegant way to make this happen. Let's create a single-cell table on the same page, holding the word you're searching for. (Ideally, this could be a drop-down list -- and that can be made to dynamicly hold all the discrete values in column D -- but that's another discussion.) Let's call this table "Search".
    Add a column (which can be hidden) to your original table. Let's insert this next to your column D, making it column E. Cell E2 contains =IF($D2=Search :: $A$1,TRUE,FALSE). Drag/copy that down the column. You'll now have a value of TRUE in this column for all the words you're looking for. Now click on the top of this column E and click "Show More Options".... and click on "Show rows that match the following". Set it to show where Column E is true. You now show only the words in which the "category" matches the search word.
    Change the word in your Search table, and the display of your original table automatically adjusts.
    The nice part is that the entire line is displayed so you can see definitions and contexts as well.
    Vince

  • Views - SELECT from VIEW and SELECT from the query inside view definition returning different results

    Hi,
    I am facing this weird issue. Any help would be appriciated.
    I have view with the following definition:
    CREATE VIEW [marketing].[OpenedMails]
    AS
    SELECT
    ID_EmailAddress, 
    ID_Date_Opened, 
    ID_Contact, 
    ID_MailSendJobs,
    COUNT(ID_OpenedMails) AS OpenCount,
    CASE
    WHEN ROW_NUMBER() OVER (PARTITION BY CAST(ID_EmailAddress AS VARCHAR(10)) + ' ' + CAST(ID_MailSendJobs AS VARCHAR(10)) ORDER BY ID_Date_Opened) = 1 THEN 1 
    ELSE 0 
    END
    AS UniqueOpenCount
    FROM            
    dbo.Fact_OpenedMails
    where ID_Contact = 382340
    GROUP BY ID_EmailAddress, ID_Date_Opened, ID_Contact, ID_MailSendJobs;
    order by ID_MailSendJobs 
    When I run the the select statement in the view definition I get combination of both 1 and 0 for the 'UniqueOpenCount' column.
    But when I run the select from the view itself using the following query:
    SELECT [ID_EmailAddress]
          ,[ID_Date_Opened]
          ,[ID_Contact]
          ,[ID_MailSendJobs]
          ,[OpenCount]
          ,[UniqueOpenCount]
      FROM [marketing].[OpenedMails]
    I get equal amount of rows but only 0 values for the 'UniqueOpenCount' column which seems to be very weird to me. Why is this happening ? Can anyone help regarding how to solve this ??
    Result from the select inside view definition:
    Result from the select query directly from the view:
    Thanks in advance.
    Vivek Kamath

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. You failed. Temporal
    data should use ISO-8601 formats – you failed again. Code should be in Standard SQL AS much AS possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    Things like “ID_Date_Opened” are wrong. The affixes “id” and “date” are called attribute properties in ISO-11179 and data modeling. Since a date is a unit of measurement on a temporal scale, it cannot be an identifier by definition. My guess is this would be
    “open_date” if it were done right. And the only display format in ANSI/ISO Standard SQL is ISO-8601 (yyyy-mm-dd)
    An email address of -1?? Email addresses are VARCHAR(256), not numeric. There is no reason to cast them AS string!
    Your vague “mail_send_jobs” is plural, but columns hold scalars and cannot be plural by definition. The partition cause can hold a list of columns: 
    WHEN ROW_NUMBER() 
         OVER (PARTITION BY email_address, mail_send_job 
                   ORDER BY open_date)
         = 1 
    THEN 1 ELSE 0 END 
    This still makes no sense, but the syntax is better. You do not understand how ROW_NUMBER() works. 
    Would you like to try again with proper Netiquette? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Same query returns differenent result sets in oracle 9i and 10g

    Could anyone please clarify the issue i am having on a query. I have query that is returning around 2000 records in oracle db 9.2.0.8.0, at the same time with same data if run on 10.2.0.1.0 is returning only 12 records.
    what might be the reason for this descrepancy, is something in 9i is considered differently in 10g?
    Here is the query.
    SELECT
    0
    ,ot_req_head.rh_sys_id
    ,ot_req_head.rh_comp_code
    ,ot_req_head.rh_txn_code
    ,ot_req_head.rh_no
    ,ot_req_head.rh_appr_uid
    ,'Action to be taken' action
    ,ot_req_head.rh_appr_dt
    ,NULL AUTH_TO_UID
    ,NULL
    ,NULL
    ,NULL from_remarks
    ,NULL
    ,NULL
    ,'REQ'
    ,ot_req_head.rh_amd_no
    ,ot_req_head.rh_amd_dt
    ,ot_req_head.rh_cr_uid
    ,DECODE(ot_req_head.rh_charge_area_num,6,ot_req_head.rh_locn_code,1,ot_req_head.rh_charge_code,NULL)
    ,ot_req_head.rh_cr_dt
    ,NULL
    FROM
    orioni.om_txn_setup,
    orioni.ot_req_head,
    iscoit.isco_txn_auth,
    SELECT DISTINCT rh_sys_id
    FROM orioni.pending_mr
    )pending_mr
    WHERE
    ot_req_head.rh_txn_code=txns_txn_code
    AND
    auth_comp_code(+)=ot_req_head.rh_comp_code
    AND
    auth_action_to_type(+) IS NULL
    AND
    auth_head_sys_id(+)=ot_req_head.rh_sys_id
    AND
    auth_txn_code(+)=ot_req_head.rh_txn_code
    AND
    ot_req_head.rh_clo_status IS NULL
    AND
    ot_req_head.rh_comp_code='001'
    AND
    txns_txnp_code='PURREQ'
    AND
    txns_values='N'
    AND
    ot_req_head.rh_appr_status=3
    AND
    ot_req_head.rh_sys_id = pending_mr.rh_sys_id
    AND NOT EXISTS
    SELECT 'X'
    FROM
    iscoit.isco_txn_auth A
    WHERE
    a.auth_head_sys_id = isco_txn_auth.auth_head_sys_id
    AND
    a.auth_action_from_uid = ot_req_head.rh_appr_uid
    AND
    a.auth_action_from_type = 'Action to be taken'
    AND
    a.auth_action_from_dt = ot_req_head.rh_appr_dt
    AND
    NVL(a.auth_txn_amend_no,0) = NVL(ot_req_head.rh_amd_no,0)
    AND
    a.auth_action_to_type = 'REJECT'
    AND
    ot_req_head.rh_cr_dt > TO_DATE('16-MAR-2008','DD-MON-YYYY')
    Edited by: unus on Oct 19, 2009 3:56 AM
    Edited by: unus on Oct 19, 2009 4:18 AM

    Here's what I got on 9i and 10G:
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    SQL> CREATE TABLE T_1(VAL1 NUMBER,VAL2 VARCHAR2(10));
    Table created.
    SQL> CREATE TABLE T_2(VAL1 NUMBER,VAL2 VARCHAR2(10));
    Table created.
    SQL> INSERT INTO T_1 VALUES(1,'FIRST');
    1 row created.
    SQL> INSERT INTO T_1 VALUES(2,'SECOND');
    1 row created.
    SQL> INSERT INTO T_2 VALUES(1,'FIRST');
    1 row created.
    SQL> INSERT INTO T_2 VALUES(2,'SECOND');
    1 row created.
    SQL> INSERT INTO T_1 VALUES(3,'THIRD');
    1 row created.
    SQL> INSERT INTO T_1 VALUES(4,'FOURTH');
    1 row created.
    SQL> INSERT INTO T_1 VALUES(5,'FIFTH');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> SELECT A.VAL1,B.VAL1 FROM
      2  T_1 A,T_2 B
      3  WHERE A.VAL1=B.VAL1;
         VAL1      VAL1
            1         1
            2         2
    SQL> SELECT A.VAL1,B.VAL1 FROM
      2  T_1 A,T_2 B
      3  WHERE A.VAL1=B.VAL1(+);
         VAL1      VAL1
            1         1
            2         2
            3
            4
            5
    SQL> SELECT A.VAL1,B.VAL1 FROM
      2  T_1 A,T_2 B
      3  WHERE A.VAL1=B.VAL1(+)
      4  AND
      5  NOT EXISTS (SELECT 'X' FROM t_2 C WHERE c.val1=b.val1);
         VAL1      VAL1
            3
            4
            5
    SQL> select name, value from v$parameter where name like '%optimizer%' or name like '%cursor_sharing
    NAME                                                             VALUE
    cursor_sharing                                                   EXACT
    optimizer_features_enable                                        9.2.0
    optimizer_mode                                                   CHOOSE
    optimizer_max_permutations                                       2000
    optimizer_index_cost_adj                                         100
    optimizer_index_caching                                          0
    optimizer_dynamic_sampling                                       1
    -- 10G
    Verbonden met:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> SELECT A.VAL1,B.VAL1 FROM
      2  T_1 A,T_2 B
      3  WHERE A.VAL1=B.VAL1;
          VAL1       VAL1
             1          1
             2          2
    SQL> SELECT A.VAL1,B.VAL1 FROM
      2  T_1 A,T_2 B
      3  WHERE A.VAL1=B.VAL1(+);
          VAL1       VAL1
             1          1
             2          2
             5
             4
             3
    SQL> SELECT A.VAL1,B.VAL1 FROM
      2  T_1 A,T_2 B
      3  WHERE A.VAL1=B.VAL1(+)
      4  AND
      5  NOT EXISTS (SELECT 'X' FROM t_2 C WHERE c.val1=b.val1);
          VAL1       VAL1
             3
             4
             5( Please use the tag before and after your example, so we're sure we're looking at your complete example )                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for