The to_date() error in where clause of proc code

In a proc code, firstly I use "SELECT to_char(f_date_1, 'DDMONYY') into :char_date FROM TBL_1;" to get the value of f_date_1.
Then I use "SELECT ID FROM TBL_2 WHERE f_date_2 = :char_date;" to get the value of ID according char_date.
In table, the type of f_date_1 and f_date_2 is DATE.
char_date is "char char_date[10]".
My question is:
1. If I use WHERE f_date_2 = to_date(:char_date, 'DDMONYY'), it will prompt: "-1861, ORA-01861: literal does not match format string".
2. If I use WHERE f_date_2 = :char_date, it will work well.
Since the type of f_date_2 is DATE and the type of char_date is CHAR, why does to_date(:char_date, 'DDMONYY') have problems?
Thanks.

I was not able to duplicate the error you got, but I did spot something that may be affecting your results:
*Set up test table using HR.EMPLOYEES*
create table TEST_DATE as
select employee_id, last_name, hire_date
from employees
var char_date char(10)
begin
select to_char(hire_date,'DDMONYY') into :char_date
from test_date
where rownum = 1;
end;
*case 1*
select *
from test_date
where hire_date = to_date(:char_date,'DDMONYY')
*case 2*
select *
from test_date
where hire_date = :char_date --> this assumes a implicit char to date conversionWhile I got case 2 to work, it assumes that the database is configured to recognize the character mask as a valid string format. If you tried running that query on a different database, this query may fail as well.
To verify why case 1 may not have worked, do a quick check:
select :char_date from dualIt is possible that you may have applied a different character mask between your first query:
>
SELECT to_char(f_date_1, 'DDMONYY') into :char_date FROM TBL_1;
>
and the WHERE clause of your second query:
>
WHERE f_date_2 = to_date(:char_date, 'DDMONYY')
>
RP

Similar Messages

  • Syntax error in WHERE clause

    Hi all,
    see the code.
    data: itab type cdhdr occurs 0,
            wa type cdhdr.
    data: begin of itab1 occurs 0,
             lifnr like lfa1-lifnr,
              ktokk like lfa1-ktokk,
            end of itab1.
    select * from cdhdr into table itab.
    select lifnr ktokk from lfa1 into table itab1
        for all entries in itab
          where lifnr = itab-objectid.
    when i go for Syntax check i am getting Error like  " when using the addition for all entries in itab " the fields  LIFNR and ITAB-OBJECTID  must have the same type and lengh.
    so, i have done the following correction in WHERE clause.
    select lifnr ktokk from lfa1 into table itab1
        for all entries in itab
          where lifnr = itab-objectid(10).
    But this time i am geting warning in German language.
    my correction is correct or not ?
    Pls guide me ..
    Thanks
    Krupali.

    select lifnr ktokk from lfa1 into table itab1
    for all entries in itab
    where lifnr = itab-objectid(10).
    But this time i am geting warning in German language.
    my correction is correct or not ?
    Answer is your correction is not correct.
    we cannot use offset with for all entries.
    you can do this way first take the itab-objectid(10) in some other field like temp than fire for all entries on temp.
    like below.
    select lifnr ktokk from lfa1 into table itab1
    for all entries in itab
    where lifnr = itab-temp."<-- see here
    Amit.
    Edited by: Amit Gujargoud on Aug 26, 2008 8:00 AM

  • DATAMOVER: Error: Syntax error in where clause for PSOPRDEFN

    SET LOG C:\PSUSER_HRM.log;
    SET input F:\psoprdefn.dat;
    IMPORT psoprdefn where OPRId = 'PS';
    when i execute this command after importing .dat file from my database i get error:
    Error: Syntax error in where clause for PSOPRDEFN
    any suggestions pls help....
    Thanks
    aravind
    Edited by: 967641 on Nov 20, 2012 11:39 AM
    Edited by: 967641 on Nov 20, 2012 11:40 AM

    That is correct.
    Datamover tries to insert data in PSOPRDEFN and rows exist with these keys.
    To avoid this you can add the following statement in your script:
    SET UPDATE_DUPS;
    This will update the values other than the keys if a row already exists in the database with the keys in the dat file.
    I can advice you to buy the new book of Jim Marion, PeopleSoft PeopleTools Data Management and Upgrade Handbook
    http://www.amazon.com/PeopleSoft-PeopleTools-Management-Upgrade-Handbook/dp/0071787925/ref=sr_1_1?ie=UTF8&qid=1353575734&sr=8-1&keywords=jim+j+marion
    It has an entire chapter on how to use datamover.
    Hakan

  • Problem: Error in WHERE clause. Unrecognized clause or element.

    Hi All,
    i have a replicat and tried to filter some rows:
    This was my MAP-Statement in the param-file:
    MAP GOMS3KT, TARGET goldengate.txlog,
    COLMAP (
    tsid = #IDTIMESTAMP(),
    syskey = SYSKEY,
    type = "KT",
    trxtimestamp = #TRAILJULIANTS(),
    acquirer = #ACQFILTER(acq-id-schema_1,acquirer-id_1,log-item-length_2),
    origin = #ASSERTDEFAULT2(bezugssystem_1 ," " ,log-item-length_2),
    issuer = #MANIPULATEISSUER(bezugssystem_1, ISS-ID-SCHEMA_1, ISSUER-ID_1, -1, log-item-length_2)
    ) where (bezugssystem_1 = "PSVL");
    At runtime, i got this error:
    2013-02-25 09:09:42 WARNING OGG-00869 No unique key is defined for table 'TXLOG'. All viable columns will be used to represent the
    key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
    ...(bezugssystem_1 = "PSVL")...
    ^
    Error in WHERE clause. Unrecognized clause or element.
    The column 'bezugssystem_1' does exist, i mapped it before to a the oracle column 'origin'
    What is wrong here ??
    I i delete the where clause all works fine!
    Edited by: Felix_GG on 26.02.2013 15:44
    Edited by: Felix_GG on 26.02.2013 18:25

    Of course, in the where clause should stand a '=' or what i wrote (but is not able to show) the signs for NOT EQUAL, a 'less than' followed by a 'greater then'

  • Force the order in which WHERE clauses are applied?

    I need to make sure that one where clause filtering is applied before the other. How do I do that?
    Several of my where clauses are below.
    I need to make sure than the where clause in bold is applied before several where clauses on the bottom. Otherwise, I get error: division by 0.
    where ...
    and a.surveydate = (select max(surveydate) from survey
    where id = a.id
    and surveydate < b.surveydate
    and b.surveydate between TO_DATE('&lowdate','DD-MON-YYYY')
    and TO_DATE('&highdate','DD-MON-YYYY')
    and (
    ( abs( (b.totvacant/totunits - a.totvacant/totunits) /
    (b.surveydate - a.surveydate) * 365 ) >= 0.00 )
    or ( abs( (b.avgcost/ a.avgcost -1 ) /
    (b.surveydate - a.surveydate) * 365 ) >= 0 )
    or ( abs( (b.free_rent - a.free_rent ) /
    (b.surveydate - a.surveydate) * 365 ) >= 0 )
    Thank you. I know very little about query optimization, but I have a sense that I need to use some kind of SQL hint.

    Why not rewrite the where clause a bit to intercept »ORA-01476: divisor is equal to zero«?:
    SELECT *
      FROM tab
    WHERE a.surveydate =
              (SELECT MAX (surveydate)
                 FROM survey
                WHERE ID = a.ID
                  AND surveydate < b.surveydate
                  AND b.surveydate BETWEEN TO_DATE ('&lowdate', 'DD-MON-YYYY')
                                       AND TO_DATE ('&highdate', 'DD-MON-YYYY')
                  AND (   (ABS ((b.totvacant / totunits - a.totvacant / totunits
                                / NULLIF (b.surveydate - a.surveydate, 0) * 365
                               ) >= 0.00
                       OR (ABS ((b.avgcost / a.avgcost - 1)
                                / NULLIF (b.surveydate - a.surveydate, 0) * 365
                               ) >= 0
                       OR (ABS ((b.free_rent - a.free_rent)
                                / NULLIF (b.surveydate - a.surveydate, 0) * 365
                               ) >= 0
                      ))

  • Beginner: Getting syntax error on WHERE clause in SELECT

    I'm very new to php and mySQL.  Am using DW master/detail to generate to basic code I need.  One thing I need to do is modify a select statement in the master to include a WHERE clause to limit the selection to a particular value in one field.
    I'm getting a syntax error with the WHERE clause I'm adding to the map select statement.
    This is the portion of the error message showing the error location:
    'WHERE Group='Community' LIMIT 0, 10'
    The php that generated the select is:
    $query_maps = "SELECT * FROM tblmaps ORDER BY tblmaps.DispSeq";
    $query_limit_maps = sprintf("%s WHERE Group='%s' LIMIT %d, %d", $query_maps, $selectGroup, $startRow_maps, $maxRows_maps);
    This approach to creating the select statement is from the code generated for the master page.  It adds the LIMIT clause.  All I did was add the "WHERE Group='%s' and the $selectGroup variable which comes from earlier code.  You can see that the $selectGroup variable is equal to the "Community: group.
    I've scanned the web to see what syntax error I might be making but haven't found anything that explains it.
    The full resolved select statement is:
    SELECT * FROM tblmaps ORDER BY tblmaps.DispSeq WHERE Group='Community' LIMIT 0,10
    What am I not seeing?
    Tom

    Thanks.  Make sense but changing that didn't help.
    Here's the error message I'm getting:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Group='Community' ORDER BY tblmaps.DispSeq LIMIT 0, 10' at line 1
    The full select (from a debugging ECHO I inserted) is:
    SELECT * FROM tblmaps WHERE Group='Community' ORDER BY tblmaps.DispSeq LIMIT 0, 10
    Note that when I take the WHERE clause out, there is no syntax error.

  • SELECT LIST throws error for WHERE CLAUSE

    Hi All
    I am struck with, what looking like a trivial error, but I don't know how to settle it down. I am new to Apex (3.1). I am experimenting with. I have Oracle 10g running on Windows.
    I have a dropdown item in one of my pages (SELECT list). I am trying to display few items there dynamically (depends on the user who logged in). I set it as SELECT LIST and entered the following query in "List of Values".
    select enrolled_course display_value, course_id return_value
    from COMP_LIST
    where stu_id = :APP_USER
    order by 1I got the following error.
    1 error has occurred
    LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.Then, I tried the step by step instruction from "Oracle® Application Express - Advanced Tutorials -Release 3.1.2 -E10497-02". Using creating list of values creation as seperately. That too, I got the same error.
    I am doing it wrong I suppose. Please correct me. Thanks in advance
    With Regards
    Guru
    Edited by: guru paran on Oct 16, 2008 5:12 PM

    Thanks Andy
    When I hardcoded, it worked.
    select enrolled_course display_value, course_id return_value
    from COMP_LIST
    --where-- --emp_id-- = --100--
    where stu_id = 100
    order by 1
    {code}
    :APP_USER is not working then, Now, I should be using v('APP_USER')? When I tried v('APP_USER'), I got the same error back! The COMP_LIST is a view. Is there some problem with the view then?
    But again, I am able to select from it without WHERE (now with hardcoded value also)....
    Edited by: guru paran on Oct 16, 2008 6:26 PM
    Added [code] tags
    Edited by: guru paran on Oct 16, 2008 6:42 PM
    It is STU_ID and not EMP_ID
    Edited by: guru paran on Oct 16, 2008 6:43 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Merge query error in Where clause

    Following error is coming when i execute the merge query. Anything wrong with this? I am using Oracle 9.2.0.1.
    Query:
    MERGE
         INTO incompletekalls ic
         USING live_small ls
         ON ((ls.callid = ic.callid) AND
         (ls.sdate = ic.sdate) AND
         (ls.stime = ic.stime))
    WHEN MATCHED THEN
         UPDATE
         SET     ic.adate = ls.adate,
              ic.atime = ls.atime,
              ic.edate = ls.edate,
              ic.etime = ls.etime
         WHERE
              ls.sdate = '16-Apr-09' AND ls.stime >= '09:00:00' AND ls.stime <= '11:00:00' AND ((ls.adate IS NULL) OR
              (ls.edate IS NULL))
    WHEN NOT MATCHED THEN
         INSERT (ic.callid,ic.cg,ic.cd,ic.re,ic.opc,ic.dpc,ic.sdate,ic.stime,ic.adate,ic.atime,ic.edate,ic.etime)
         VALUES (ls.callid,ls.cg,ls.cd,ls.re,ls.opc,ls.dpc,ls.sdate,ls.stime,ls.adate,ls.atime,ls.edate,ls.etime)
         WHERE ls.sdate >= '16-Apr-09' AND ls.stime >= '09:00:00' AND ls.stime <= '11:00:00'
    Error:
    SQL> /
    WHERE
    ERROR at line 13:
    ORA-00905: missing keyword

    Hi,
    From looking at the documented examples
    http://www.oracle.com/pls/db92/db92.drilldown?levelnum=2&toplevel=a96540&method=FULL&chapters=0&book=&wildcards=1&preference=&expand_all=&verb=&word=MERGE#a96540
    and on http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5318183934935
    I think that you cannot use the WHERE in your MERGE like that on 9i...
    Something else I want to warn you for:
    It's a bad idea to store your date and time separated as strings! You'll run into troubles sooner or later, for 100%...
    Use a single DATE column instead, in which you store both the date and time components..

  • The initialization of sqlca.sqlerrm.sqlerrmc in proc code

    In a proc code, after a EXEC SQL block, the value of sqlca.sqlcode and sqlca.sqlerrm.sqlerrmc will be set to certain value.
    If I use two SQL continuously, the value of sqlca.sqlerrm.sqlerrmc will be reset after the second SQL. However, if the value of sqlca.sqlerrm.sqlerrmc is "ABCD" in the first SQL and the value returned by the second SQL is "EFG", whether the value of sqlca.sqlerrm.sqlerrmc after the second SQL will be set to "EFG" correctly? Or whether I need to use "memset(sqlca.sqlerrm.sqlerrmc, 0, sizeof(sqlca.sqlerrm.sqlerrmc));" before the second SQL in order to ensure the correct value of sqlca.sqlerrm.sqlerrmc? How about sqlca.sqlcode?
    Thx in advance.

    I assume you are referring to the PRO*C language?
    You're in the wrong forum, this is for SQL and PL/SQL languages. Please find the correct forum and post there instead.

  • To_Date Slow in Where Clause

    Hi,
    I have Simple Oraclae query..
    Table: testTable
    Field: timestamp
    Data Type: Date
    timestamp filed date like '2/2/2012 10:15:11 AM' format.
    Index : No index On this table
    i want fetch the records between dates..
    while execution the query its take long time while run the query if we Don't have any data in table beetween date.
    if we have data between dates.. got result...
    query look like
    select * from TestTable
    where timestamp between TO_Date('Feb 3 2012 10:00AM', 'MM/dd/yyyy HH12:MI AM') and sysdate
    as per above query , i don't have data after 3 rd feb... its took long time for geting result..
    how can i decrese the execution time...
    Edited by: 919325 on Mar 7, 2012 3:47 AM

    Hi,
    I did a test with this data
    SQL> with data as (
    select 'a' as a, systimestamp-30 as timestamp from dual
    union all
    select 'b', systimestamp-20 from dual
    union all
    select 'c', systimestamp-10 from dual
    union all
    select 'd', systimestamp-5 from dual
    union all
    select 'e', systimestamp from dual)
    select * from data;
    A TIMESTAMP
    a 06-FEB-12 12.44.34.000000 PM +01:00
    b 16-FEB-12 12.44.34.000000 PM +01:00
    c 26-FEB-12 12.44.34.000000 PM +01:00
    d 02-MAR-12 12.44.34.000000 PM +01:00
    e 07-MAR-12 12.44.34.529572 PM +01:00
    SQL> with data as (
    select 'a' as a, systimestamp-30 as timestamp from dual
    union all
    select 'b', systimestamp-20 from dual
    union all
    select 'c', systimestamp-10 from dual
    union all
    select 'd', systimestamp-5 from dual
    union all
    select 'e', systimestamp from dual)
    select * from data where timestamp > to_date('2012-03-01 10:00', 'YYYY-MM-DD HH24:MI');
    A TIMESTAMP
    d 02-MAR-12 12.45.23.000000 PM +01:00
    e 07-MAR-12 12.45.23.074227 PM +01:00and the execution was very fast. Even if I remove the two latest records, so that the query returns no rows, the execution is still fast.
    How many rows does your table consist of? What Oracle-version are you on?
    //Johan

  • What are the query errors can be rectified using trns code rsrt?

    Hi all,
    Can anyone let me know the sigifiance of trns code rsrt? with examples. Nor can anyone send me a documentation about rsrt describing its functions and significance.
    What are all the errors will be rectified using rsrt ?
    regds
    hari

    hi,
    RSRT : Query monitor to debug and test the queries. U can test IGS(internet Graphical Service) also.RSRT is to scan the query as to how the query gets executed, whether it uses aggregates or cubes, full table scan or uses index, etc.
    You can also change the performance of a query under the 'Properties' tab.
    If you switch the Read Mode to 'A' - 'Query to Read All Data at Once', it can really kill the query performance. Instead of reading data with each navigation, it reads it all before it loads. It will speed up navigation after the report has rendered, but kill the load time.
    The 'Generate Report' button can be used with the report has become corrupt. It will regenerate the report. It hasn't happened many times, but I've had reports that just failed to run when no change has been made. Regenerating the report fixed it.
    Execute + Debug is a lifesaver when you need to trace user exits in your report. It has a lot of neat options
    chk this link..
    http://help.sap.com/saphelp_nw04/helpdata/en/a0/2a183d30805c59e10000000a114084/content.htm
    hope it helps..

  • When formatting a date field in a where clause the template put dot instead of comma

    Hello to Headstart Workers !
    In a query find block the template construct a where clause, in some cases, and i dont know when the template is formatting a date field putting a dot instead of a comma.
    Ex.: to_date('19-01-2001'.'DD-MM-YYYY')
    Anybody knows why or where the template do this.
    Congratulations
    Nelson

    - We created it using the HS utilities.
    - "nls_numeric_character = ,.".
    - it onky happen when the field date is not the first field in the where clause.
    - i can see the problem just after pressing find button, already in the ls_block in last_query.
    - the find_query works normally but cannot edit any line in ls_block.
    Hope that i had helping
    Regards
    Nelson
    null

  • Delete from remote location with where clause between the two databases

    I want to delete records from a source database using dblink. The criteria for the delete is a where clause, that
    looks for the values between a table at source and the remote location. I get an invalid sql statement error.
    When i do a count(*) instead of a delete, I get rows returned.
    Can anyone see an the problem here ? I've tried qualifying the delete
    delete from tabl1@remote a, tabl1_temp b where (a."id" =b."id") and (a."title" = b."title) and (a."key" = b."key");
    the error I get is ORA 00933 SQL command not properly ended....
    The * is between the 2 ands ...
    Edited by: sgonos on Nov 6, 2009 6:46 AM
    Sorry the * moved when I save it ...
    delete from tabl1@remote a, tabl1_temp b where (a."id" =b."id") and (a."title" = b."title) and (a."key" = b."key");
    it's flagging the middle and ... a.title = b.title ... seems to like key ....
    Edited by: sgonos on Nov 6, 2009 6:51 AM

    You have 2 tables specified in the delete clause of your statement.
    It should maybe be something like:
    delete from tabl1@remote a
    where exists (select 'x' from tabl1_temp b where (a."id" =b."id") and (a."title" = b."title) and (a."key" = b."key"));
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to modify the where clause in this to include other things

    How do I modify the WHERE clause in this code:
    $expected = array(first_name, last_name, level, language, 'city', 'state', 'zip', );
    $query_search = 'SELECT * FROM french;
    $where = false;
    foreach ($expected as $var) {
    if (isset($_GET[$var]) && !empty($_GET[$var])) {
    if ($where) {
    $query_search .= ' AND ';
    } else {
    $query_search .= ' WHERE ';
    $where = true;
    $query_search .= $var . ' = '. GetSQLValueString($_GET[$var], 'text');
    to include things like searching multiple columns and IF NULL:
    SELECT * from MyTable where (MyCol1 = %s or MyCol1 Is Null) AND (MyCol2 = %s or MyCol2 Is Null)
    Where on earth does it go?
    Thanks
    Brian

    My goal is to have a search form and results combination that:
    1) allows the user to ignore any of the page’s existing search fields that
    they don’t need, (to search with empty form fields);
    2) to use whichever search form fields they choose to use even if the
    Registrant for whom they are searching did not insert that information when
    they registered, (they are filled in the search form but empty in the
    database table);
    3) and to permit some of the seach fields to search multiple columns, for
    example the search form field ‘sonsName’ would look for that information in
    three different database table colums, (sonsName1, sonsName2 etc.).
    You’ve given me code that permits 1) above to work beautifully. You’ve also
    sent along code that should let me accomplish the other two, and though I’ve
    been able to recreate below what I want the multiple search column to do, I
    can get neither the multiple column nor the IS NULL sections to work in the
    code you sent most recently.
    How do I take something like this:
    $colname_rsSearch = "-1";
    if (isset($_POST['first_name_now'])) {
      $colname_rsSearch = $_POST['first_name_now'];
    $colname2_rsSearch = "-1";
    if (isset($_POST['last_name_now'])) {
      $colname2_rsSearch = $_POST['last_name_now'];
    $colname3_rsSearch = "-1";
    if (isset($_POST['sonsName'])) {
      $colname3_rsSearch = $_POST['sonsName'];
    mysql_select_db($database_connStr_Milo_db, $connStr_Milo_db);
    $query_rsSearch = sprintf("SELECT milo.first_name_now, milo.last_name_now,
    milo.ws_number, milo.ws_number_3, milo.ws_number_4 FROM milo WHERE
    milo.first_name_now = %s AND milo.last_name_now = %s AND (milo.sonsName1 =
    %s) ||  (milo.sonsName2 = %s) || (milo.sonsName3 = %s)",
    GetSQLValueString($colname_rsSearch,
    "text"),GetSQLValueString($colname2_rsSearch,
    "text"),GetSQLValueString($colname3_rsSearch,
    "text"),GetSQLValueString($colname3_rsSearch,
    "text"),GetSQLValueString($colname3_rsSearch, "text"));
    $rsSearch = mysql_query($query_rsSearch, $connStr_Milo_db) or
    die(mysql_error());
    $row_rsSearch = mysql_fetch_assoc($rsSearch);
    $totalRows_rsSearch = mysql_num_rows($rsSearch);
    ?> (I’ve excluded the IS NULL part from my example, but need it in the final
    version)
    …and make it work using your code below (which permits someone to search
    with empty form fields, but does not yet enlighten me on what to group (with
    parenthesis) to make the code execute the multiple column search and the IS
    NULL parts of the search.
    mysql_select_db($database_connStr_Milo_db, $connStr_Milo_db);
    $expected = array('first_name_now', 'last_name_now', sonsName'
    $query_search = 'SELECT milo.first_name_now, milo.last_name_now,
    milo.ws_number, milo.ws_number_3, milo.ws_number_4  FROM milo';
    $where = false;
    foreach ($expected as $var) {
      if (isset($_POST[$var]) && !empty($_POST[$var])) {
        if ($where) {
          $query_search .= ' AND ';
        } else {
          $query_search .= ' WHERE ';
          $where = true;
      $query_search .= '(' . $var . ' = '. GetSQLValueString($_POST[$var],
    'text') .
      ' OR ' . $var . ' IS NULL)';
    $search = mysql_query($query_search, $connStr_Milo_db) or
    die(mysql_error());
    $row_search = mysql_fetch_assoc($search);
    $totalRows_search = mysql_num_rows($search);
    As always, thank you.

  • SQL query optimization by changinf the WHERE clause

    Hi all,
    I need to know about the SQL query performance improvement by changing the WHERE clause. Consider a query :
    select * from student where country ='India' and age = 20
    Say, country = 'India' filters 100000 records and age = 20 filters 2000 records if given one by one. Now can anyone tell if the performance of the query can be changed by changing the query like this :
    select * from student where age = 20 and country ='India'
    as first where clause will give 2000 results and next filter will be applicable on only 2000 rows. While in the former query first where clause would give 100000 rows and seconde filter, hence, would be applicable on 100000 rows???
    Kindly explain.
    Thanks in advance.
    Abhideep

    in general the order of the where condition should not be important. However there are a few exeptions where sometimes it might play a role. Sometimes this is called order of filter conditions. Among others it depends on RBO or CBO used, Oracle Version, Indexes on the columns, statistic information on the table and the columns, CPU statistics in place etc.
    If you want to make this query fast and you know that the age column has much better selectivity then you can simply put an index on the age column. An index on the country column is probably not useful at all, since to little different values are in this column. If you are already in 11g I would suggest to use a composite index on both columns with the more selective in first position.
    Edited by: Sven W. on Nov 17, 2008 2:23 PM
    Edited by: Sven W. on Nov 17, 2008 2:24 PM

Maybe you are looking for

  • Google TGM does not open new tab

    I only use the FF search bar in the upper right corner, no other toolbars are installed. The google search with the little blue "g" opens find within the same tab that is currently open. The Google(TGM) used to open the search page in a new tab and n

  • Value add with G-ATP

    Hi we currently have DP and SNP , we are looking on to add value with G-ATP, can any one list out points for what value addition can be done by implementing G-ATP.

  • Having button take you back to page where you came from

    I am trying to create a mockup of cover letter (page 1) and a Quick menu on Page2. The cover letter page (1) contains no interactive material. On page two (Quick menu), my mockup has one button for taking you to an external page called quote. When yo

  • Compiling servlets - package javax.servlet not found

    I can't seem to get the previous questions on this topic - get a page error. I've recently installed j2ee1.4 and j2sdk1.4.1_01 on Win98. I think I've set the CLASSPATH and PATH correctly (and JAVA_HOME). What have I missed?

  • Has anyone got the game show ap called countdown plz

    I Used to have this so but it's dissapeared