Select a Select question

Hello world

As you know I am fairly new to Oracle and SQL. I just have a question.
Does that mean when I have a question like that.

Select *.
(Select BLA bla
The blah blah
where blah blah
) qry_tab

What I want to know is when and why would I do that? And what it does here? Thank you very much.

Hello

Z KHAN wrote:
Thanks frank. May I ask when and why would I want to use this approach well?

A common reason is that there is something that you can calculate from the existing data, and you want to treat that calculated the value as if it were a column.

An example of use of the table scott.emp. That you intend to give a 5% increase for employees in management positions (i.e., employees who have jobs 'MANAGER' or 'PRÉSIDENT'), and increase by 10% to employees in positions of work (i.e., all other jobs). Let's say, moreover, that for the 30 Department, we want only show management employees, and that the job class is required for sorting. In other words, we want these results:

ENAME          DEPTNO        SAL JOB       JOB_CLASS     NEW_SAL
---------- ---------- ---------- --------- ---------- ----------
MILLER             10       1300 CLERK     Labor            1430
SMITH              20        800 CLERK     Labor             880
SCOTT              20       3000 ANALYST   Labor            3300
FORD               20       3000 ANALYST   Labor            3300
ADAMS              20       1100 CLERK     Labor            1210
KING               10       5000 PRESIDENT Management       5250
CLARK              10       2450 MANAGER   Management     2572.5
JONES              20       2975 MANAGER   Management    3123.75
BLAKE              30       2850 MANAGER   Management     2992.5

Here's a way to do it:

SELECT       ename, deptno, sal, job
,       job_class                    -- (1)
,       CASE
           WHEN  job_class = 'Management'     -- (2)
           THEN  1.05
           ELSE  1.10
       END * sal          AS new_sal
FROM       (                       -- Begin in-line view got_job_class
           SELECT  ename, deptno, sal, job
           ,           CASE
                          WHEN  job IN ('MANAGER', 'PRESIDENT')
                 THEN  'Management'
                 ELSE     'Labor'
                      END      AS job_class
           FROM    scott.emp
       ) got_job_class          -- End in-line view got_job_class
WHERE       deptno           != 30
OR       job_class          = 'Management'     -- (3)
ORDER BY  job_class                      -- (4)
,            deptno
;

Note that job_class is used in 4 places in the main query:
(1) in the SELECT clause
(2) in the calculation of new_sal, also in the SELECT clause
(3) in the WHERE clause
(4) in the ORDER BY clause
Without a subquery, how would you do that? Well, you can use the CASE expression that defines job_class 4 everywhere. You need to be very careful that you cut and paste exactly right. It will be ineffective because Oracle may have to do the same calculation again and again. If, next month, the business rules change (say, "Management" includes now another job), then you will need to make exact change even at 4 locations in the code. Who can be a maintenance nightmare.
It's a game much more convenient and potentially more effective, to treat the Tahina-query result as if it were a table named got_job_class in this example. With a subquery, you can set job_class once, then use the query 4, or 44 times by hand.
(Acutally, you can use aliases for columns in the ORDER BY clause, but that does not change my point).

Sometimes, repeating a calculation is not even an option. For example, if the calculation involves an analytical function and you want to use in a WHERE clause, or you want to nest analytic functions. These are things that you must do in a separate query. You can define a view, but is not very practical, and it leads to a cluttered data dictionary.

Tags: Database

Similar Questions

  • Selection question tab

    I created three buttonfields like this.

    final CreateCustomField field1 = new CreateCustomField ("First tab", ButtonField.FOCUSABLE |) ButtonField.CONSUME_CLICK);
    "final CreateCustomField field2 = new CreateCustomField second tab", ButtonField.FOCUSABLE | ButtonField.CONSUME_CLICK);
    "final CreateCustomField field3 = new CreateCustomField third tab", ButtonField.FOCUSABLE | ButtonField.CONSUME_CLICK);

    I add this in to the HorizontalFieldManager like that.

    HFM HorizontalFieldManager = new HorizontalFieldManager(Manager.USE_ALL_WIDTH|NO_HORIZONTAL_SCROLL);
    HFM. Add (field1);
    HFM. Add (Field2);
    HFM. Add (field3);

    It is added to the main screen like that.

    Display display = new MainScreen();

    mainScreen.add (hfm);

    Now, three tabs (buttons) horizontal at the top of the main screen.

    Now, I'm clicking on a tab, and the corresponding content must be loaded under the tabs.

    I do like it.

    HFM HorizontalFieldManager = new HorizontalFieldManager (Manager.USE_ALL_WIDTH |) Manager.NO_HORIZONTAL_SCROLL);
    HFM. Add (new CreateCustomField ("First tab", ButtonField.FOCUSABLE |)) ButtonField.CONSUME_CLICK));
    HFM. Add ("new CreateCustomField of tab", ButtonField.FOCUSABLE |) ButtonField.CONSUME_CLICK));
    HFM. Add ("new CreateCustomField third tab", ButtonField.FOCUSABLE |) ButtonField.CONSUME_CLICK));

    mainScreen.add (hfm);   Top tabs added to the screen
    VFM VerticalFieldManager = new VerticalFieldManager();
    VFM. Add (new LabelField ("is to test the rendering of dynamic content"));   This is to add the content when you click on the tab.                mainScreen.add (vfm);  Content added to screen

    pushScreen (mainScreen);

    The questions is when clicking on the tab, the content is load and the selected tab is not selected.

    Hope the above information helps.

    Thanks in advance

    Bala.

    Certainly not need a FocusListener I think... But the setFocus() should be submitted... Let me give you an example... When an action takes place, you can focus on a hfm... Therefore, the button will implement a setChangeListener, and in your fieldChanged(), shoud encode you the setFocus...

    Hope this makes sense...

    See you soon...

  • AnyConnect optimized gateway selection question

    Hello

    I'm evaluating Cisco Anyconnect VPN for my business. Can someone let me know what will happen if optimized customer selected gateway is full?

    Thank you

    Deepak

    Hello

    With an optimal selection of front door the first time that AC is running on the machine check the answer RTT for each server / gateway configured in the XML file and use the one with the lowest value as the main access door.

    These results will be cached by the client, so in case the primary gateway fails or is not responding somehow, HQ will automatically use the second gateway in the list.

    As clients of HQ the assessment of the entry door that only once, it is recommended to test for a stable connection.

    More information:

    Select operation optimal gateway AnyConnect

    Please let me know if that answers your question.

    Thanx.

    Portu

  • Cisco Valet M10 Wireless channel selection question

    Hello

    You're not sure if someone knows or not, but I wonder how the option on the configuration page wireless router, channel selection work?

    My Valet m10 (firmware: 2.0.03) offer an option manually set the wireless channel or put it on "Automatic" and I was wondering when the option is set to 'Auto', how many times don't change router channel.

    Does it change after reboot?

    Or it changes periodically all on its own?

    Thank you

    How auto channel is supposed to work, is that the router is a poll figures and wireless channel is the best at the moment to reduce the interference of signals between the channels.

    This feature doesn't work well on some routers and manual adjustment of the chain is the best.

  • SELECT question beginner

    I have a table like:

    Name type value ¦ ¦

    John 123 CreditCard ¦ ¦

    Stefan 456 PhoneNumber ¦ ¦

    Stefan 789 CreditCard ¦ ¦

    and I need a query SELECT with the final result:

    Name ¦ ¦ PhoneNumber CreditCard

    John ¦ 123

    Stefan ¦ 789 456

    SQL > ed
    A written file afiedt.buf

    1 with t (nm, val, typ) as long as)
    2. Select 'John', 123, "CreditCard" dual union all
    3 select "Stefan", 456, 'PhoneNumber' from dual union all
    4 Select "Stefan", 789, 'credit card' of the double
    5        )
    6  --
    7 end of test data, using following query against the clean table
    8  --
    9. Select nm
    10, max (decode (typ, "credit card", val)) as credit card
    11, max (decode (typ, 'Téléphone', val)) as phone number
    12 t
    13 nm group
    14 * order by 1
    15.

    CREDIT CARD NUMBER PHONE NM
    ------ ---------- -----------
    John 123
    Stefan 789 456

  • Table tree select questions

    Hi all

    I use Jdeveloper 12.1.2.0.0.

    My requirement is to select the checkbox all rows in a table from the tree root level when the user clicks a checkbox control named selectAll (this box resides outside the TreeTable). If the user disables the selectAll checkbox all rootLevel in tree lines must be unchecked.

    The tree has two levels. I used a transitional mode attribute in the t and when the user clicks the selectall checkbox, ValueChange Listener fires and I'm looping through the lines of the iterator, setting the transient value to be true.

    It works fine all the time but not the first time. When I click on the for the first time selectAll checkbox, the ValueChange listener fires but the treeTable lines are not get verified. The second time, it works perfectly.

    I have a partial trigger to the TreeTable.

    If I use a button instead of a check, it works fine all the time.

    Could someone help me.

    Do not know what causes this. Have you tried in jdev 12.1.3?

    To work around the problem, you can but a button hidden on the page and the queue an event to actin the listener to change value of the check box for the button. So easy the key dies at work, and it should work.

    Timo

  • create the table in SELECT (question)

    Hello

    In regards to create the table as subquery, I read that:

    The data type of column definitions and the NOT NULL constraint are passed to the new table. Note that only the explicit NOT NULL constraint is inherited. The PRIMARY KEY column will not function NOT NULL column null. Any other rule of constraint is not passed to the new table. However, you can add constraints in the column definition.

    Can someone explain to me how to do this? Or, how we need to specify the constraints (and also the default values for columns, because it is possible) for the columns in the column definition?

    In addition, I do not understand this: the PRIMARY KEY column will not function NOT NULL column zero.
    Can someone give me some small examples regarding these?
    For example, it generates an error:
    create table test1 (a, b, c default sysdate) 
    as 
    select 1, 'b' from dual
    Thank you!

    Edited by: Roger22 the 01.09.2011 11:37

    Hello

    When you set a primary key consists of a unique constraint and a constraint not null, but they are both implicit with the primary key. When you create the table because it will copy only the explicitly declared NOT NULL constraints so it isn't look upward than the implicit NOT NULL primary key.

    SQL> create table dt_pk
      2  (   id      number primary key,
      3      col1    number not null,
      4      col2    number
      5  )
      6  /
    
    Table created.
    
    SQL> desc dt_pk
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ID                                        NOT NULL NUMBER
     COL1                                      NOT NULL NUMBER
     COL2                                               NUMBER
    
    SQL> create table dt_pk2 as select * from dt_pk;
    
    Table created.
    
    SQL> desc dt_pk2;
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ID                                                 NUMBER
     COL1                                      NOT NULL NUMBER
     COL2                                               NUMBER
    
    SQL> select constraint_name,constraint_type from user_constraints where table_name='DT_PK'
      2  /
    
    CONSTRAINT_NAME                C
    ------------------------------ -
    SYS_C006935772                 C
    SYS_C006935773                 P
    
    SQL> select constraint_name,constraint_type from user_constraints where table_name='DT_PK2'
      2  /
    
    CONSTRAINT_NAME                C
    ------------------------------ -
    SYS_C006935774                 C
    

    However, a primary key can reuse existing constraints and indexes instead of declaring new. For example, we can explicitly declare a constraint not null on the column id and then create a primary key. This means that we will now inherit the constraint not null in the ETG, as it has been explicitly declared and is a constraint separate in there own right that has been 'borrowed' by the pk constraint.

    SQL> create table dt_pk3 (id number not null, col1 number not null, col2 number);
    
    Table created.
    
    SQL> alter table dt_pk3 add constraint dt_pk3_pk primary key (id);
    
    Table altered.
    
    SQL> select constraint_name,constraint_type from user_constraints where table_name='DT_PK3'
      2  /
    
    CONSTRAINT_NAME                C
    ------------------------------ -
    SYS_C006935775                 C
    SYS_C006935776                 C
    DT_PK3_PK                      P
    
    SQL> create table dt_pk4 as select * from dt_pk3;
    
    Table created.
    
    SQL> desc dt_pk3;
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ID                                        NOT NULL NUMBER
     COL1                                      NOT NULL NUMBER
     COL2                                               NUMBER
    
    SQL> desc dt_pk4;
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ID                                        NOT NULL NUMBER
     COL1                                      NOT NULL NUMBER
     COL2                                               NUMBER 
    

    Regarding the definition of the default values, you must always specify the column in the select, but doing so means follow you the semantics of a default in a standard INSERT statement, i.e. you specified the column, you must provide a value, in which case even if the value is null, the default value will not be used. However, the new inserted rows where the column with the default value is not specified will revert to the default.

    SQL> create table test1 (a, b, c default sysdate)
      2  as
      3  select 1, 'b' from dual
      4  /
    create table test1 (a, b, c default sysdate)
                        *
    ERROR at line 1:
    ORA-01730: invalid number of column names specified
    
    SQL> create table test1 (a, b, c default sysdate)
      2  as
      3  select 1, 'b', null c from dual
      4  /
    select 1, 'b', null c from dual
                   *
    ERROR at line 3:
    ORA-01723: zero-length columns are not allowed
    
    SQL> create table test1 (a, b, c default sysdate)
      2  as
      3  select 1, 'b', cast(null as date) c from dual
      4  /
    
    Table created.
    
    SQL> select * from test1;
    
             A B C
    ---------- - ---------
             1 b
    
    SQL> insert into test1(a,b) values(2,'b');
    
    1 row created.
    
    SQL> select * from test1;
    
             A B C
    ---------- - ---------
             1 b
             2 b 01-SEP-11
    

    To create a constraint, you must list all columns without the data types and constraints list online.

    SQL> create table dt_cons (id number, col1 number, col2 number, constraint chk2 check(col2 IS NULL or col2>10))
      2  as select * from dt_pk3
      3  /
    create table dt_cons (id number, col1 number, col2 number, constraint chk2 check(col2 IS NULL or col2>10))
                          *
    ERROR at line 1:
    ORA-01773: may not specify column datatypes in this CREATE TABLE
    
    SQL> create table dt_cons (constraint chk2 check(col2 IS NULL or col2>10))
      2  as select * from dt_pk3
      3  /
    create table dt_cons (constraint chk2 check(col2 IS NULL or col2>10))
                         *
    ERROR at line 1:
    ORA-00904: : invalid identifier
    
    SQL> create table dt_cons (col2 constraint chk2 check(col2 IS NULL or col2>10))
      2  as select * from dt_pk3
      3  /
    create table dt_cons (col2 constraint chk2 check(col2 IS NULL or col2>10))
                          *
    ERROR at line 1:
    ORA-01730: invalid number of column names specified
    
    SQL> create table dt_cons (id,col1,col2 constraint chk2 check(col2 IS NULL or col2>10))
      2  as select * from dt_pk3
      3  /
    
    Table created.
    
    SQL> desc dt_cons
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ID                                        NOT NULL NUMBER
     COL1                                      NOT NULL NUMBER
     COL2                                               NUMBER
    
    SQL> insert into dt_cons values(2,2,2);
    insert into dt_cons values(2,2,2)
    *
    ERROR at line 1:
    ORA-02290: check constraint (JJACOB_APP.CHK2) violated
    
    SQL> insert into dt_cons values(2,2,10);
    insert into dt_cons values(2,2,10)
    *
    ERROR at line 1:
    ORA-02290: check constraint (JJACOB_APP.CHK2) violated
    
    SQL> insert into dt_cons values(2,2,11);
    
    1 row created.
    
    SQL> insert into dt_cons values(2,2,null);
    
    1 row created.
    
    SQL>
    

    HTH

    David

  • Object/image to toggle the selection question

    Went from CS3 to CS5 and discovered that they reorganized image selection. Can't tell if I'm cropping the image or resizing. With the selected object selection tool, the image of the circle seems to indicate that it is safe to crop, but it's still an uncertain when you work quickly. Is there any way to disable this, so I can go back to the more intuitive object select and direct, select as separate functions. (in other words, the default CS3)

    Really a pain when you're importing, cropping, and resizing. These object help executives fail to make the problem worse. I'm happy that they allow you to disable those 5.5.

    TIA

    View > Extras > hide content Grabber will turn off the "donut hole."

  • syntax Select question, how does the V.*

    Hi all
    I am new to ORacle and resembles the code example, as below, I couldn't find any reference to this V.* which refers to all columns and defined in Oralce docs after the ORDER, and also I can not reproduce this in my site. If confused, maybe it's just for the code sample and not legimate. Can someone point to the right place, how to read how it works. This code is valid?

    TX
    T
    SELECT PKID
          ,NAME, PRODUCT_NUMBER, PROD_TYPE, TO_DATE
    --      */
    FROM   (SELECT ROWNUM RNUM     ,V.*
              FROM (SELECT   PKID
                            ,NAME
                            ,PRODUCT_NUMBER
                            ,PROD_TYPE
                            ,TO_DATE
                        FROM PRODUCT PRD
                       WHERE 1 = 1 AND PROD_TYPE = 'Sell'
                    ORDER BY UPPER (NAME) DESC) V
             WHERE ROWNUM <= :V_CNT2)
     WHERE RNUM >= :V_CNT;

    This subquery in your code was given an alias name 'V' which is used in the actual query as V.*
    If you want to you can provide a different alias name namely "qry" and its reference as qry.* columns

    (SELECT   PKID
                            ,NAME
                            ,PRODUCT_NUMBER
                            ,PROD_TYPE
                            ,TO_DATE
                        FROM PRODUCT PRD
                       WHERE 1 = 1 AND PROD_TYPE = 'Sell'
                    ORDER BY UPPER (NAME) DESC)
    

    Hope that's clear.

  • SQL Tuning Advisor on a select Question

    Hi all.
    10.2.0.4 RAC
    I have a select sequential reading of file db high. I used sql tuning advisor on OEM, and the Adviser show me these recommendations:
    RECOMMENDATIONS
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    GENERAL INFORMATION SECTION
    -------------------------------------------------------------------------------
    Tuning Task Name                  : SQL_TUNING_1266335308111
    Tuning Task Owner                 : SYSTEM
    Scope                             : COMPREHENSIVE
    Time Limit(seconds)               : 1800
    Completion Status                 : COMPLETED
    Started at                        : 02/16/2010 16:48:44
    Completed at                      : 02/16/2010 16:50:06
    Number of SQL Profile Findings    : 1
    
    -------------------------------------------------------------------------------
    Schema Name: CRM
    SQL ID     : b7cd8jntqpcgu
    SQL Text   : select * from ( select this_.ENVIO_ID as ENVIO1_33_0_,
                 this_.NOMCLIENTE as NOMCLIENTE33_0_, this_.NOMCONTACTO as
                 NOMCONTA3_33_0_, this_.APLICACION_ID as APLICACION4_33_0_,
                 this_.PRIORIDAD as PRIORIDAD33_0_, this_.MEDIO as MEDIO33_0_,
                 this_.MEDIO_VALOR as MEDIO7_33_0_, this_.ESTADO as ESTADO33_0_,
                 this_.ESTADO_DESC as ESTADO9_33_0_, this_.FEC_PREVISTA as
                 FEC10_33_0_, this_.FECHA_ENVIO as FECHA11_33_0_,
                 this_.REC_CLIENTE as REC12_33_0_, this_.FECHACREA as
                 FECHACREA33_0_, this_.FECHAMODIF as FECHAMODIF33_0_,
                 this_.FLAGBLOQUEO as FLAGBLO15_33_0_, this_.FLAGBORRADO as
                 FLAGBOR16_33_0_, this_.COMENTARIOS as COMENTA17_33_0_,
                 this_.HORAENVIO as HORAENVIO33_0_, this_.EMISOR as EMISOR33_0_,
                 this_.IDENTIFICADOR as IDENTIF20_33_0_, this_.MEDIO_VALOR_DESC
                 as MEDIO21_33_0_, this_.DEBUG_TRACE as DEBUG22_33_0_,
                 this_.FORMULARIO_ID as FORMULARIO23_33_0_, this_.CAMPANYA_ID as
                 CAMPANYA24_33_0_, this_.CONTACTO_ID as CONTACTO25_33_0_,
                 this_.USUARIOCREA as USUARIO26_33_0_, this_.USUARIOMODIF as
                 USUARIO27_33_0_, this_.CLIENTE_ID as CLIENTE28_33_0_,
                 this_.CAMPPOS_ID as CAMPPOS29_33_0_, this_.ACTIVIDAD_ID as
                 ACTIVIDAD30_33_0_, this_.TAGCLICONEXT_ID as TAGCLIC31_33_0_ from
                 CRM.CRM_ENVIOS this_ where this_.MEDIO=:1 and this_.ESTADO=:2
                 and this_.FECHA_ENVIO<=:3 order by this_.ENVIO_ID asc ) where
                 rownum <= :4
    
    -------------------------------------------------------------------------------
    FINDINGS SECTION (1 finding)
    -------------------------------------------------------------------------------
    
    1- SQL Profile Finding (see explain plans section below)
    --------------------------------------------------------
      A potentially better execution plan was found for this statement.
    
      Recommendation (estimated benefit: 99.43%)
      ------------------------------------------
      - Consider accepting the recommended SQL profile.
        execute dbms_sqltune.accept_sql_profile(task_name =>
                'SQL_TUNING_1266335308111', replace => TRUE);
    
    -------------------------------------------------------------------------------
    ADDITIONAL INFORMATION SECTION
    -------------------------------------------------------------------------------
    - The optimizer could not merge the view at line ID 2 of the execution plan.
      The optimizer cannot merge a view that contains an "ORDER BY" clause unless
      the statement is a "DELETE" or an "UPDATE" and the parent query is the top
      most query in the statement.
    
    -------------------------------------------------------------------------------
    EXPLAIN PLANS SECTION
    -------------------------------------------------------------------------------
    
    1- Original With Adjusted Cost
    ------------------------------
    Plan hash value: 3505713201
    
    ----------------------------------------------------------------------------------------------
    | Id  | Operation                     | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT              |              |     1 |  4416 |   604K  (1)| 02:00:53 |
    |*  1 |  COUNT STOPKEY                |              |       |       |            |          |
    |   2 |   VIEW                        |              |     1 |  4416 |   604K  (1)| 02:00:53 |
    |*  3 |    TABLE ACCESS BY INDEX ROWID| CRM_ENVIOS   |     1 |   352 |   604K  (1)| 02:00:53 |
    |   4 |     INDEX FULL SCAN           | SYS_C0020438 |  2718K|       |  8153   (1)| 00:01:38 |
    ----------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - filter(ROWNUM<=:4)
       3 - filter("THIS_"."MEDIO"=:1 AND "THIS_"."ESTADO"=:2 AND
                  "THIS_"."FECHA_ENVIO"<=:3)
    
    2- Using SQL Profile
    --------------------
    Plan hash value: 3391889105
    
    ------------------------------------------------------------------------------------------------------
    | Id  | Operation                      | Name                | Rows  | Bytes | Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT               |                     |     1 |  4416 |  3431   (1)| 00:00:42 |
    |*  1 |  COUNT STOPKEY                 |                     |       |       |            |          |
    |   2 |   VIEW                         |                     |     1 |  4416 |  3431   (1)| 00:00:42 |
    |*  3 |    SORT ORDER BY STOPKEY       |                     |     1 |   352 |  3431   (1)| 00:00:42 |
    |*  4 |     TABLE ACCESS BY INDEX ROWID| CRM_ENVIOS          |     1 |   352 |  3430   (1)| 00:00:42 |
    |*  5 |      INDEX SKIP SCAN           | APLICACIONENVIO_IDX |     1 |       |  3429   (1)| 00:00:42 |
    ------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - filter(ROWNUM<=:4)
       3 - filter(ROWNUM<=:4)
       4 - filter("THIS_"."MEDIO"=:1 AND "THIS_"."FECHA_ENVIO"<=:3)
       5 - access("THIS_"."ESTADO"=:2)
           filter("THIS_"."ESTADO"=:2)
    
    -------------------------------------------------------------------------------
    I think the main problem is the order, but when I run autotrace traceonly without order by the plan of the explain command is diferent to advise:
    SELECT *
      2    FROM (SELECT this_.envio_id AS envio1_33_0_,
      3                 this_.nomcliente AS nomcliente33_0_,
      4                 this_.nomcontacto AS nomconta3_33_0_,
      5                 this_.aplicacion_id AS aplicacion4_33_0_,
      6                 this_.prioridad AS prioridad33_0_, this_.medio AS medio33_0_,
      7                 this_.medio_valor AS medio7_33_0_, this_.estado AS estado33_0_,
      8                 this_.estado_desc AS estado9_33_0_,
      9                 this_.fec_prevista AS fec10_33_0_,
     10                 this_.fecha_envio AS fecha11_33_0_,
     11                 this_.rec_cliente AS rec12_33_0_,
     12                 this_.fechacrea AS fechacrea33_0_,
     13                 this_.fechamodif AS fechamodif33_0_,
     14                 this_.flagbloqueo AS flagblo15_33_0_,
     15                 this_.flagborrado AS flagbor16_33_0_,
     16                 this_.comentarios AS comenta17_33_0_,
     17                 this_.horaenvio AS horaenvio33_0_, this_.emisor AS emisor33_0_,
     18                 this_.identificador AS identif20_33_0_,
     19                 this_.medio_valor_desc AS medio21_33_0_,
     20                 this_.debug_trace AS debug22_33_0_,
     21                 this_.formulario_id AS formulario23_33_0_,
     22                 this_.campanya_id AS campanya24_33_0_,
     23                 this_.contacto_id AS contacto25_33_0_,
     24                 this_.usuariocrea AS usuario26_33_0_,
     25                 this_.usuariomodif AS usuario27_33_0_,
     26                 this_.cliente_id AS cliente28_33_0_,
     27                 this_.camppos_id AS camppos29_33_0_,
     28                 this_.actividad_id AS actividad30_33_0_,
     29                 this_.tagcliconext_id AS tagclic31_33_0_
     30            FROM crm.crm_envios this_
     31               where this_.estado = 'Enviado'
     32           and this_.medio = 3482 AND this_.fecha_envio <= '02/04/10 00:00:00')
     33   WHERE ROWNUM <= 500;
    
    no rows selected
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1577868436
    
    ------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name            | Rows  | Bytes | Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT             |                 |   500 |   171K|  2425   (1)| 00:00:30 |
    |*  1 |  COUNT STOPKEY               |                 |       |       |            |          |
    |*  2 |   TABLE ACCESS BY INDEX ROWID| CRM_ENVIOS      |   500 |   171K|  2425   (1)| 00:00:30 |
    |*  3 |    INDEX RANGE SCAN          | ESTADOENVIO_IDX |       |       |   104   (0)| 00:00:02 |
    ------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - filter(ROWNUM<=500)
       2 - filter(TO_NUMBER("THIS_"."MEDIO")=3482 AND "THIS_"."FECHA_ENVIO"<='02/04/10
                  00:00:00')
       3 - access("THIS_"."ESTADO"='Enviado')
    
    
    Statistics
    ----------------------------------------------------------
              1  recursive calls
              0  db block gets
         138277  consistent gets
          45240  physical reads
              0  redo size
           2629  bytes sent via SQL*Net to client
            488  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              0  rows processed
    I was looking for a way to see who wear's Advisor using his plan, but didn't see a way of knowing on docs, or at least I have not found it.
    Can someone show me that some light on what changes made Advisor to select to reach that way, or how can I watch this that select uses?
    Any help will be appreciate
    Thank you

    The Adviser does not create a new SQL statement - what it has done is create a SQL profile - to accept SQL profile for the task of tuning above:

        execute dbms_sqltune.accept_sql_profile(task_name =>
                'SQL_TUNING_1266335308111', replace => TRUE);
    

    as mentioned in the above report...

    A sql profile applys tips for change (correct) the cost of certain operations - and, to change the execution path chosen by the optiimizer.

  • CP5: Rating and Quiz result slides for selected Questions

    Hello world

    I am trying to create a course that has several "knowledge checks" that need not be striped or track, then a 10 question at the end quiz that must be marked and tracked.

    Someone does know of a way to separate these two elements so that the slide Quiz results do not cover my data 'check knowledge' and gives just the details of the user of the 10 question quiz? I would also use the progress bar, but only for the last 10 questions.

    Moreover, if the result of the quiz screen separated the results of controls knowledge quiz, which would work as well.

    Thank you
    Graham

    Hello

    If you are using the Question slides that come with Captivate, all slides will be added to the total score because you can have than a Quiz in a CP-file.

    Some ideas: you can assign to the partition of the first (not to follow) slides to 0, or if possible change issues marked the investigation (no is not marked).

    If by progress, you mean the indication ' Question X of Y ", there, you'll need to do your own counters, with variables user and advanced actions. If you want to have total control of your question slides, that you can create the first group issues yourself and use only default to the last real Quiz Question slides. Just published a blog post today with a few links to articles on customizing quizzes. Feel free to check it out:

    Customize your Quiz using advanced actions

    Lilybiri

  • Questions using C3 and Plateau OnDemand

    I am having some problems with the functionality/reports of a quiz. It's only my second draft statement, then I'm really my back started with this question. The first course/quiz reports perfectly, functions perfectly and not return any errors. The only difference between the two is method declaration. The first one uses other SCORM, AICC. The quiz on the problem itself is 25 randomly selected questions from a pool with a slide of the intro (total 27 slides). I use SCORM 1.2 content being housed at the iContent and OnDemand Plateau containing the actual LMS (we are completely farmed, with the exception of the development). These are the problems that I work with.
    Bookmarking - if I leave the quiz in the Middle before the end and run it again, I'm back to where I left when that I raise. If I get at the end of the quiz and fail and start again to resume it, I takes me to question 23 and am not able to resume the quiz of all.
    Continue the results screen button - does not seem to do anything when you click it if I do not see the course. If I pass the course, everything works perfectly.

    Any help would be greatly appreciated. I looked in the forums to try to avoid a double post, but nothing really treated this specific issue. Sorry, that's such a long post

    Hi MrFrankZ and welcome to the forums!

    I don't think that the questionnaires are intended to be put into bookmark in SCORM. My understanding is that if a quiz is not performed in one session, it must be restarted from scratch. It's the 'proper' approach is to disable bookmarking for quiz (in Captivate 2, I think that it's the "never send summary data" option in the Quiz Manager |) Tip section. Button settings... do not know where it is in Captivate 3).

    That said, you can try to score the quiz in "optional" option and uncheck the "user must answer all questions" in the Quiz Manager and see if that fixes things for you.

    The only downside I see is that if you * make it work, I doubt integrated Quiz Resumepage of Captivate can give them credit for the questions that they answered at the previous session. At best, it would be misleading to the user when they access the Quiz summary page, and in the worst case the user would never get credit for the course (if they have too few questions left to give them an overall pass mark).

    When you do that, you're probably better to just disable the bookmarking and demanding of questionnaires from the beginning every time.

  • Why don't I have easily select my questions open after the connection support?

    Why don't I have easily select my questions open after the connection support?

    When I connect support communities, I have still no clear idea where to find my support questions which remain open to check updates.

    Seems to me that this should be a great, distinct and separate button on the homepage of support after you have connected.  "My open issues Apple Community Support."

    Is this too much to ask?

    Steve

    1. Click / tap your username
    2. Click / tap 'manage subscriptions '.

  • ACS 5.2 selection policy/access service attribute question

    Hello

    I use ACS 5.2.0.26 and formed the selection air Service to authenticate the PEAP wireless clients based on the suffix of the domain that is used by clients. If I use the IETF-RADIUS-RADIUS attribute: User name to do this, am I right to say that this corresponds to the 'roaming identity' as opposed to the actual connection of the users id?

    In respect of Access Services, I can use the system attribute: username that corresponds to real customers login id-based. My questions are:

    Is the IETF RADIUS: use attribute Name corresponds to the "roaming identity"?

    Can I use the system attribute: user name with access but not it seems with a selection of the Service strategy. Why is this?

    Thank you

    Andy

    Hello

    Is the IETF RADIUS: use attribute Name corresponds to the "roaming identity"?

    -> No.The roaming identity is specific to certain claimants and didn't always match the user name.

    If the roaming identity is cleared, %domain%\%username% is the default value.

    When 802. 1 x MS RADIUS is used as an authentication server, the server authenticates the device using the username identity of roaming of the Intel PROSet/Wireless software and ignores the authentication protocol MS-CHAP-V2 user name. This feature is the 802 identity. 1 x supplied by the authenticator. Microsoft IAS RADIUS accepts only a valid username (dotNet user) for EAP clients. When 802. 1 x MS RADIUS is used, enter a valid user name. For all other servers, this is optional. Therefore, it is recommended to use the desired domain (for example, [email protected] / * /) instead of a true identity.

    Can I use the system attribute: user name with access but not it seems with a selection of the Service strategy. Why is this?

    -> Because this attribute is not valid for function selection policy. It was designed this way... we can't do anything.

    HTH,
    Tiago

    --

    If this helps you or answers to your question if it you please mark it as 'responded' or write it down, if other users can easily find it.

  • Narrative questions - there is no audio selection

    I can't get the narrative to save because I get a message saying that my selection of current hardware has all the input channels. But when I go in the selections of audio material is only an option, 'First Elements WDM' Audio.  Clearly, everything that it is does not work.

    When I went online to Watch youtube videos or any other instructions, the poster in question seems to have a large number of parts, but not on my computer. I even tried another computer on windows, I have, but it has the same problem. It will achieve a record with or without headphones.

    BTW, the helmet works, because I'm able to make superb recordings on recorder Windows resident.  But I can't import the latter first.

    I use a 64-bit windows 10 computer.

    If I can't get the Narrator working, I'd love to be able to import audio clips of my tape recorder resident, but the system will not do that either.  Is it possible to make these files in a format that can be imported in first 14?  It's a very high quality sound recorder.

    Thanks for your help.

    If you got this message via the Premiere Elements forum page, you should see a button to correct answer under this post.

Maybe you are looking for