Date range of calculation with the SQL statement

I'm sure that there is a way to do this in SQL, but I can't understand it. I can write a PL/SQL script to do it, but prefer to use a SQL statement. My database is the database of Oracle 10.2.0.4.0.

I have a table that contains information such as employee number, service id, and date effective start-up of the person in this Department. There are data in another table I want to update their department number in based on their date of entry in the range. If I could figure out how to correctly select the entry into force, I can do the rest.

I have data such as:
EMP_ID DEPT_NO EFFECTIVE
-------------- ----------------- ---------------------
101 1000 1/15 / 2001
1050 101 5/24 / 2005
101 2010 6/8/2008
101 1000 8/2/2010

I want to write a SELECT statement that returns something like this where the end_date is the eve of the ENTRY into force and the last record didn't an end_date because they are always assigned to this service. In addition, the first record in the column, I won't choose a DEPT_NO because the logic of the entry into force has been added in January 2001, he says if a person started in 1985 they might have zero departments at several times so I won't update all data for this period:

EMP_ID DEPT_NO EFFECTIVE END_DATE
--------------- ---------------- ---------------- ----------------
101 1/14 / 2001
101 1000 1/15 / 2001 5/23/2005
1050 101 5/24 / 2005 6/7/2008
101 2010 6/8/2008-8/1/2010
101 1000 8/2/2010

Here is a script to create the data into a temporary table which can be used to write a SELECT statement. I added two records of employees with different dates.

create the table temp_activity
(emp_id number (12),)
dept_no number (12).
(entry into force);

INSERT INTO temp_activity
(EMP_ID, DEPT_NO, ENTERED INTO FORCE)
VALUES
(101,1000,to_date('1/15/2001','MM/DD/YYYY'))
/
INSERT INTO temp_activity
(EMP_ID, DEPT_NO, ENTERED INTO FORCE)
VALUES
(101,1050,to_date('5/24/2005','MM/DD/YYYY'))
/
INSERT INTO temp_activity
(EMP_ID, DEPT_NO, ENTERED INTO FORCE)
VALUES
(101,2010,to_date('6/8/2008','MM/DD/YYYY'))
/
INSERT INTO temp_activity
(EMP_ID, DEPT_NO, ENTERED INTO FORCE)
VALUES
(101,1000,to_date('8/2/2010','MM/DD/YYYY'))
/
INSERT INTO temp_activity
(EMP_ID, DEPT_NO, ENTERED INTO FORCE)
VALUES
(102,1040,to_date('1/15/2001','MM/DD/YYYY'))
/
INSERT INTO temp_activity
(EMP_ID, DEPT_NO, ENTERED INTO FORCE)
VALUES
(102,2000,to_date('6/16/2006','MM/DD/YYYY'))
/

Any help is appreciated. It's probably easy, but I can't get my brain wrapped around it.

Thanks - mike
select  emp_id,
        dept_no,
        effective,
        end_date
  from  (
          select  emp_id,
                  dept_no,
                  effective,
                  lead(effective) over(partition by emp_id order by effective) - 1 end_date,
                  row_number() over(partition by emp_id order by effective) rn
            from  temp_activity
         union all
          select  emp_id,
                  null dept_no,
                  null effective,
                  min(effective) - 1 end_date,
                  0 rn
            from  temp_activity
            group by emp_id
        )
  order by emp_id,
           rn
/

    EMP_ID    DEPT_NO EFFECTIVE  END_DATE
---------- ---------- ---------- ----------
       101                       01/14/2001
       101       1000 01/15/2001 05/23/2005
       101       1050 05/24/2005 06/07/2008
       101       2010 06/08/2008 08/01/2010
       101       1000 08/02/2010
       102                       01/14/2001
       102       1040 01/15/2001 06/15/2006
       102       2000 06/16/2006

8 rows selected.

SQL> 

SY.

Tags: Database

Similar Questions

  • OSB: fn - bea: execute - sql () with the sql statement ' INSERT INTO...» »

    Dear Experts,

    I need a clarification. Is it possible to use the fn - bea: function execute sql (Oracle Service Bus) to perform an insert operation in a database with the data extracted from the message of the Organization (i.e. $body/Info/username)? If it is possible which is the right syntax?
    Any suggestion is appreciated.

    Kind regards
    Mike

    Published by: ITDeveloper on November 19, 2009 2.55

    Published by: ITDeveloper on November 19, 2009 3.01

    Hi Mike,.

    Please refer to my post for the same question to the fn - bea: sql performance with 'Insert INTO' the sql statement

    Thank you best regards &,.

    Vivek

  • How to fill a variable in the script with the sql statement

    Hello

    I am trying to replace the toad by SQL Developer. I would like to start a main script, which selects the database name and host name and makes this information on behalf of a spoolfile and then rolls into this spoolfile.

    As a result, I am able to see when and on what database the spoolfile belongs to.

    With SQL * more or Toad, I was able to make it work with:

    set SKRIPTNAME = "Mainscript_Release_4.04_00".

    Set serveroutput on

    undefine spoolfile

    column spoolfile new_value by spoolfile

    SELECT ' & SKRIPTNAME' | ' _'|| ora_database_name | » _'|| LOWER (HOST_NAME) | » _'|| To_char (sysdate, 'yyyymmdd_hh24miss'): '. Newspaper ' spoolfile of v$ instance;

    coil & & spoolfile

    -call other scripts here

    spool off

    Anyone knows a solution for this in SQL Developer scripts?

    Best regards, Stefan

    Just use this script. It worked for me.

    I made a small adjustment - something SQLDev could write, vs, I changed the default directory that will be the directory \bin that they run on.

  • Help with the insert statement

    Hello

    I was wondering if someone could help write me a sql statement.

    Here is my table:
    CREATE TABLE "TEMP_INVOICE" 
       ("INVOICE" VARCHAR2(100 BYTE),
         "DATE_OF_DOCUMENT" DATE, 
         "DATE_OF_PAY_DAY" DATE, 
         "D" NUMBER, 
         "K" NUMBER
       );
    Here are the instructions for correct insertion. This time, I posted 2 examples with 2 numbers different otherwise.
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (1000,to_date('01.02.2012','dd.mm.yyyy'),to_date('01.03.2012','dd.mm.yyyy'),5000,0);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (1000,to_date('01.04.2012','dd.mm.yyyy'),'','',1000);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (1000,to_date('01.05.2012','dd.mm.yyyy'),'','',3000);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (1000,to_date('01.06.2012','dd.mm.yyyy'),'','',1000);
    
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (2000,to_date('01.07.2012','dd.mm.yyyy'),to_date('01.09.2012','dd.mm.yyyy'),8000,0);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (2000,to_date('01.10.2012','dd.mm.yyyy'),'','',5000);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (2000,to_date('01.11.2012','dd.mm.yyyy'),'','',2000);
     
    insert into temp_invoice (invoice,DATE_OF_DOCUMENT,DATE_OF_PAY_DAY,d,k)  values (2000,to_date('01.12.2012','dd.mm.yyyy'),'','',1000);
    I want to do is make an insert allows you to table another call is MADE:
    CREATE TABLE "INVOICE" 
       ("INVOICE" VARCHAR2(100 BYTE),
        "DATE_OF_DOCUMENT" DATE, 
         "DATE_OF_PAY_DAY" DATE,
         "DATE_OF_PAYMENT_REC" DATE,
         "VALUE" NUMBER,
         "VALUE_DEDUCT" NUMBER,
        "DATE_FROM" DATE,     
         "DATE_TO" DATE
         );
    Statements in the INVOICE table should be like this:


    ........ The Bill... date_of_document... date_of_pay_day... date_of_payment_rec... value... value_deduct... Date_from... Date_to
    1......     1000...............1.1.2012.................1.3.2012................NULL............................ 5000... NULL... 1.3.2012...1.4.2012
    2......     1000...............1.4.2012.................NULL..................... 1.4.2012...1000... 4000... 2.4.2012... 1.5.2012
    3......     1000...............1.5.2012.................NULL..................... 1.5.2012...3000... 1000... 2.5.2012... 1.6.2012
    4......     1000...............1.6.2012.................NULL..................... 1.6.2012...1000


    Can someone help me with the sql statement that would insert data from table to table Bill temp_invoice as in the example?

    Thank you!

    PS

    I would try to explain.
    (1) the first statement that is to be inserted is original imply that at which is different DATE_OF_PAY_DAY to NULL.
    To this inserted negative of the original imply, we must add date_from that is exatly the same date_of_pay_day and date_to which is exactly the same as the date of the first payment. Payment which came first!
    (2) we have now in the second insert statement. It will be the first payment of lease with date_of_document and date_pf_payment_rec, which is the same as date_fo_document. Value field will be populated with the amount of payment received and value_deduct field will be the value of the original imply - value of the first payment. Date is date_of_document + 1 and date_to is the date of the next payment.
    (3) Insert us the next installment. Date_od_payment_rec is the same as date_of_document... value is the amount of the second payment and value_deduct's previous value_deduct which was of 4000 - value of this second payment. date_from date_of_payment_rec + 1 and date_to is the date of the next payment

    So we continue this same pattern until we reached the final payment when we finish insert with the statement:
    Date of the document (date of the last payment received) and even for date_of_payment_rec and field value with the amount of the payment receieved. The rest (value_deduct, date_from, date_to) is null.

    I really hope you understand what I'm trying to do here.

    If you have any other questions please.

    Published by: user13071990 on November 22, 2012 04:16

    Published by: user13071990 on November 22, 2012 04:16

    Hello

    user13071990 wrote:
    ... Here are the instructions for correct insertion. This time, I posted 2 examples with 2 numbers different otherwise.

    Ok!
    Be sure to post the results you want new data.

    You probably need to add "PARTITION BY the Bill" to all analytical clauses in my solution:

    INSERT INTO invoice
    ( invoice, date_of_document, date_of_pay_day, date_of_payment_rec
    , value,   value_deduct,     date_from,           date_to
    )
    SELECT       invoice
    ,       date_of_document
    ,       date_of_pay_day
    ,       CASE
               WHEN  k > 0
               THEN  date_of_document
           END          AS date_of_payment_rec
    ,       NVL (d, k)     AS value
    ,       NVL2 ( date_of_pay_day
                , NULL
                , SUM (d) OVER ( PARTITION BY  invoice
                                          ORDER BY      date_of_document
                         )
                - SUM (k) OVER ( PARTITION BY  invoice
                                          ORDER BY      date_of_document
                         )
                )     AS value_deduct
    ,       NVL ( date_of_pay_day
               , date_of_document + 1
               )          AS date_from
    ,       LEAD (date_of_document) OVER ( PARTITION BY  invoice
                                            ORDER BY      date_of_document
                               )
                          AS date_to
    FROM       temp_invoice
    ;
    

    Because I'm not an English speaker nativ, that I just posted what it should look like after the insert is successful.

    OK, so you can't explain as you want, but you still need to explain.

    ... @Frank Kulash: you are very close, but still not quite what I'm looking for.

    Point out where my solution is the production of incorrect results, and explain (as you can) how to get good results in these places.

  • VIX file in the user interface designer receives the data from the Web service application that communicates with the SQL server database

    I created the Web service VI ("Mt-insolacije.vi"), which has two terminals of the input string (FROM / TO) for the dates of arrival and exit of two data terminals (table 1 d) from database (MS SQL server). This VI communicates with the database with functions of the database with a DSN and SQL query appropriate palette. There are two tables with two data (time and Insolation) columns in the database.

    This VI works when you run in Labview 2010, but when I used it as VI in UI Builder it returns no data.

    Could you please help me find a solution. Is it possible to communicate with the SQL server database in this way or there is another way?

    There are two files attachmet: Image of .vix file in Interface builder and .vi file ("Mt-insolacije.vi")

    Please help me ASAP!

    Thank you

    Ivan

    I found the solution problem is in the DSN. I've been using the user instead of DSN system DSN.

    It's important to create the system DSN if you want your VI of web service to communicate with the database.

    PS Please put feature bundle format timestamp and XY graph in the web user interface designer. It's complicated to trace data with datetime on X axis without them.

  • need help with the Update statement

    Hello
    I received a question in a course and I tried my best to respond, and now my brain is giving. I would really appreciate help with the update statement. I don't mind if you do not validate a solution, a little nudge in the right direction would be really useful. I'll post that I got.

    THE QUESTION
    / * For these agents disabled on more than seven missions, change their date of deactivation of the first date of deactivation of all the agents that have been activated in the same year as the agent that you update currently.
    */

    I have it divided into parts, here is my select statement to agents disabled on more than 7 missions, which produces the deactivation_dates in the agents table that I want to update...
    SELECT
    s.deactivation_date
    FROM
    (
    SELECT
    a.deactivation_date,
    count(m.mission_id) as nomissions
    FROM
    agents a
    INNER JOIN
    missions_agents m
    on
    a.agent_id=m.agent_id
    GROUP BY
    a.deactivation_date
    ) s
    WHERE
    s.nomissions>7 AND s.deactivation_date IS NOT NULL
    .. .and the code for the first date of deactivation for each year of activation agent
    select 
    a2.deactivation_date
    from
    agents a2
    where a2.deactivation_date= 
    (
    select min(a.deactivation_date)
    from 
    agents a
    where to_number(to_char(a.activation_date,'YYYY'))=to_number(to_char(a2.activation_date,'YYYY'))
    )
    ..... I am not real to marry these two statements together in the Update statement. I can't extract each date of deactivation produced in the first select statement and their match against the first date of deactivation in the year they have been activated for the second select statement.

    Any help greatly appreciated... :))

    I began to wonder how things would :)

    user8695469 wrote:
    First of all why he chooses the date the earliest of all agents

    UPDATE  AGENTS_COPY AC /* (1) */
    SET     DEACTIVATION_DATE = (
    SELECT  MIN(AGS.DEACTIVATION_DATE)
    FROM    AGENTS_COPY  AGS
    ,       AGENTS_COPY AC /* (2) */
    WHERE   TRUNC(AGS.ACTIVATION_DATE,'YEAR') = TRUNC(AC.ACTIVATION_DATE,'YEAR') /* (3) */
    )
    

    He recovers as soon as the subquery has not been correctly set in the SET clause. It seems you are trying to update a correlated, but we are still having a conceptual shift. I have added a few comments to your code above and below will explain.

    (1): when you do a correlated update it is useful to the table alias that you did right here.

    (2): this table statement is not necessary and is the reason why the FIRST deactivation date is selected. The alias that you use (3) refers to THIS table, not the one defined in the update statement. Remove the line indicated by (2) in the FROM clause and a correlated update will happen.

    and secondly why is it to update each row, when I thought that I'm just the lines where the agents are disabled and missions > 7? Pointers on where I'm wrong would be very appreciated. (SQL = stupid query language!) :)

    user8695469 wrote: then why is it to update each row, when I thought that I'm just the lines where the agents are disabled and missions > 7? Pointers on where I'm wrong would be very appreciated. (SQL = stupid query language!) :)

    
    WHERE EXISTS
    (
    SELECT
    a.agent_id,
    count(m.mission_id)
    FROM
    agents a
    /* INNER JOIN AC ON AC.AGENT_ID = A.AGENT_ID */
    INNER JOIN
    missions_agents m
    ON
    a.agent_id=m.agent_id
    GROUP BY
    a.agent_id,
    a.deactivation_date
    HAVING
    count(m.mission_id)>7 AND a.deactivation_date IS NOT NULL
    )
    

    Once again this problem is similar to the question above that a correlation update doesn't work. Test existence of lines in an EXISTS subquery. Since your subquery is not related to the table that you are trying to update, it will be always return a line and, therefore, it returns true for EACH LINE in the AGENTS table. To limit the game to only agents > 7 missions results, you need to add a join condition that references the table in your update statement. I added one above (with comments) as a sample.

    I recommend you look over all material that you have associated with correlated subqueries, including documents that I posted above. This seems to be what you're having the problem more with. If you need me to explain the concept of correlated queries any better please let me know.

    Thank you!

  • How can I pass a condition of the table in the sql statement?

    For example, in the table in the COND Varchar2 column (200) there is the value ' VAR > 10'.

    | COND |

    |' VAR > 10' |

    where VAR is the name of the table column. I would like to make statement CASE WHEN VAR > 10 AND 0... I tried with as subquery

    WHEN BOX (SELECT COND FROM TABLE WHERE...) THEN 0, but it does not work.

    Hello

    You can do this by using dynamic SQL.

    that is to say:

    declare
      v_stm      varchar2(4000);
      v_cond      varchar2(100);
      v_result    integer;
    begin
      select cond
        into v_cond
        from yourtable
      where a=1;
    
      v_stm := 'select case when '||v_cond||' then 0 ...';
    
      -- dynamic sql
      execute immediate v_stm
        into v_result;
    
    end;
    /
    

    Remember that, in general, dynamic SQL has a performance degradation that SQL static and should be avoided when possible.

    Storage condition or the SQL statements in the tables is not a good practice.

    Kind regards.

    Alberto

  • Identify the SQL statements that are executed frequently

    I would like to identify SQL statements that are executed may times (e.g., > 1000 times) during an interval AWR.

    I am aware of coloring a SQL_ID with exec ('...') dbms_workload_repository.add_colored_sql; but then the SQL ID must be known.

    Is it also possible to do the same for the (not yet known) SQL statements that are executed > 1000 times? I think that the SQL statements that run very quickly (for example 1 s <) won't be captured automatically in a CWA even if those statements are frequently performed.

    Version 11.2.0.4 on SLES11

    Try this...

    fixed lines 155

    execs from collar to 999 999 999

    Col min_etime to 999,999.99

    Col max_etime to 999,999.99

    Col avg_etime to 999,999.999

    Col avg_lio to 999,999,999.9

    Col norm_stddev to 999,999.9999

    Col begin_interval_time to a30

    node of col to 99999

    break on plan_hash_value on startup_time skip 1

    Select * from)

    Select sql_id, sum (execs), min (avg_etime) min_etime, max (avg_etime) max_etime stddev_etime/min (avg_etime) norm_stddev

    de)

    Select sql_id, execs, plan_hash_value, avg_etime,

    StdDev (avg_etime) on stddev_etime (sql_id partition)

    de)

    Select sql_id, plan_hash_value,.

    Sum (NVL(executions_delta,0)) execs,

    (sum (elapsed_time_delta) /decode (sum (nvl(executions_delta,0)), 0.1, sum (executions_delta)) / 1000000) avg_etime

    -sum ((buffer_gets_delta/decode (nvl(buffer_gets_delta,0), 0.1, executions_delta))) avg_lio

    DBA_HIST_SQLSTAT s, DBA_HIST_SNAPSHOT SS

    where ss.snap_id = S.snap_id

    and ss.instance_number = S.instance_number

    and executions_delta > 0

    Group of sql_id, plan_hash_value

    )

    )

    Group of sql_id, stddev_etime

    )

    where norm_stddev > nvl (to_number('&min_stddev'), 2)

    and max_etime > nvl (to_number('&min_etime'),.1)

    order of norm_stddev

    /

  • Procedure with the DML statements that insert values from 1 to 100 in only one table and it is matching word equivalent in the other

    Can someone help me create a procedure with the DML statements that insert values from 1 to 100 in a table "abc" and the procedure must connect the numbers into words in another table "xyz" without doing a commit explicitly. "."

    Currently on trial...

    SQL > create table abc (num number);

    Table created.

    SQL > create table xyz (num varchar2 (100));

    Table created.

    SQL > ed
    A written file afiedt.buf

    1. insert all
    2 values of 1 = 1 then in abc (num) (l)
    3 when the values of 1 = 1 then in xyz (num) (to_char (to_date(l,'j'), 'jsp'))
    4 * Select the level from dual connect by level<=>
    SQL > /.

    200 rows created.

    And the result...

    SQL > select * from abc;

    NUM
    ----------
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    ..
    ..
    ..
    98
    99
    100

    100 selected lines.

    SQL > select * from xyz;

    NUM
    ----------------------------------------------------------------------------------------------------
    one
    two
    three
    four
    five
    six
    seven
    eight
    nine
    ten
    Eleven
    twelve
    ..
    ..
    ..
    98
    Nineteen eighty
    Cent

    100 selected lines.

  • How to find the sql queries executed in one day with the sql and runtime text

    Hi Experts,

    Please tell me the sql query to find out the queries executed on a particular day and the runtime and the sql text of the query.

    Please reply urgent.

    Thanks in advance

    Database instance 'A' may have run 100 SQL queries today.  As for the instance of database 'B' could have exploited queries SQL 1 million today.  Instance of database 'B' to 'keep' the 1 million SQL statements - in memory or on disk do you expect?  Of course not.  There the age or flush or invalidate memory SQL statements.  He can't keep them on the disk (imagine running a completely different set of 1.2million SQL statements tomorrow and 1.3 the next day).

    AWR and StatsPack can make counts the number of "n" top of the page ("n" default to 30) SQL statements which are still present in the cache of the library (not years, rinsed, invalidated) when a snapshot was taken.  They can't declare "all" SQL statements.

    To return to your needs.  WHY do you need all the SQL statements?  Or are there only certain operations specific SQL would you be interested?  Could they have been treated by allowing audit (for example, UPDATE and DELETE with EXTENDED verification instructions)?

    Hemant K Collette

  • How to analysis of the XML in the sql statement?

    Hi friends, I have a table that contains a column of type CLOB, stores in xml format. For example, the data are like that

    <Employees xmlns="http://TargetNamespace.com/read_emp">
       <C1>106</C1>
       <C2>Harish</C2>
       <C3>1998-05-12</C3>
       <C4>HR</C4>
       <C5>1600</C5>
       <C6>10</C6>
    </Employees>
    
    

    So how can I write the sql statement for the analysis of the data at the top

    create or replace procedure parsing_xml

    (

    clob trans_payload

    trans_dir varchar2

    )

    as

    Start

    if(trans_dir='inbound/emp')

    then

    insert into emp_proj

    (

    employee_id

    last_name

    hire_date

    job_id

    salary

    department_id

    )

    Select t1.c1

    t1.c2

    t1.c3

    t1.c4

    t1.c5

    t1.c6

    from xmltable

    (

    XmlNamespaces ('http://TargetNamespace.com/read_emp' as 'emp').

    ' / ' emp:Employees by the way of xmltype (trans_payload)

    columns

    whole path of C1 'emp:C1. "

    path of varchar2 (10) C2 'emp:C2. "

    C3 varchar2 (10) path "emp:C3."

    C4 varchar2 (10) path "emp:C4."

    whole path of C5 "emp:C5."

    C6 varchar2 (10) path 'emp:C6 '.

    ) t1;

    end if;

    commit;

    end;

  • copy and paste the sql statement into sql * more

    How do you paste the sql statement into sql * more... I tried the following options, get the windows interface for this sequel to the documentation below, but that did not work

    http://download.Oracle.com/docs/HTML/A88829_01/ch3.htm

    then I tried to create a simple .txt file with my sql statement and tried to run using @name (where name is the name of the file) and it gives me the following error SP2-0310: cannot open the file 'firstscriot.sql '.

    You name the file name.txt? Then you cannot start with @name, because SQL * PLUS will add the extension .sql

    Try instead the @name.txt or name the file name.sql

    And check if you have the correct path.

    Concerning
    Marcus

  • How the SQL statement

    In an interview, no one asked me a question. How the sql statement
    ex: select * from emp;

    I answered him as if the select statement is in the library cache then it will retrieve data from the cache, otherwise it will retrieve data from database files. On this, he asked to go. I could not years itself. Anyone like elobarate me on the analysis?

    SMON,

    I would have preferred the official documents from Oracle, as suggested by

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16508/sqllangu.htm#CHDFCAGA

    Concerning
    Peter

  • CALL THE PROCEDURE IN THE SQL STATEMENT

    Why we cannot call a procedure inside the SQL statement?

    Hello

    Usually when you select an item should return you data. In the case of a procedure, you cannot return any return value from the procedure directly it has to be done through some settings and to access these settings, you cannot use a simple sql statement. Where as in a function, you must return one of data that can be easily obtained accordingly.

    see you soon

    VT

  • Tuning sql of a product to the seller without changing the sql statement

    Hello

    We have a product of the provider that generates the SQL statement. For a query, we get the answer in 15 seconds. But users are asking if we can bring it back to 5 seconds. Limitation is the query can not be changed. He used about 10 to 12 tables and bit complex query.

    What kind of options could be evaluated if we are to improve the performance of a query (not sure if she could never be reduced to 5 seconds)
    without making any change to the query.

    Database Version: Oracle 10.2.0.4

    Thank you
    Delphine

    Hello

    http://www.Oracle-base.com/articles/10G/AutomaticSQLTuning10g.php

    your software is enterprise or standard?

    Tuning Pack & pack diagnosis are extra cost option with the standard edition.

    & the useful note * automatic SQL Tuning - SQL [271196.1 ID] profiles *.

    http://www.Oracle.com/us/corporate/pricing/technology-price-list-070617.PDF

    Thank you

    Published by: CKPT November 5, 2010 11:12

Maybe you are looking for

  • Skype stops working when signing

    So I had to "hard" reboot my computer with the power button. Reboot and now Skype connect. It goes for a few seconds then I get a notification saying that it has stopped working and do not know if it is plugged into is chrome said that he could not v

  • Equium won't start - how to access the recovery partition?

    Hi, my sister has a 2008 Equium A200-1V0 with Vista 32-bit, that no longer starts (probably due to damage of rootkit virus). It loads the BIOS but then goes to black screen with blinking cursor. F8 does not work.F2 goes to Phoenix TrustedCore Setup u

  • USB does not errors

    Hello I hope someone can help. I have a toshiba satellite computer laptop with Vista. The laptop has only 2 USB ports, which stopped working. No indicator error in Device Manager. Just a long list including: Intel(r) ICH8 Family USB Universal Host Co

  • Exclude specific hosts to ESXi Foglight Montioring

    Hello world I have a number of hosts ESXi (more than 100) I want to exclude the Foglight monitoring all together. I think I saw a page that explains how to exclude these ESXi hosts via edit some files in Foglight. Can anyone tell how this can be done

  • How can I get my deskjet3320 to work under Windows 7?

    I try to install my deskjet 3320 on a new laptop with Windows 7 operating system. I'm running on my feature list as a device not specified rather than as a printer. How can I get Win7 to recognize?