Use a where clause clause if there is a relationship between two tables

Is it possible to use a where clause clause if there is a relationship between two tables.
I have a relationship between two tables:
And a.customer = b.customer (+)

If b.customer exists in a.customer I would add this in where clause
And b.info = 'X '.
But how?

It's the outer joins by chance?

If so, why not just:

and  b.customer(+) = a.customer
and  b.info(+) = 'X'

BTW, I put the two "b" on the left column to make it easier to read. Some people mix that makes me crazy, but makes no difference to the query.

Tags: Database

Similar Questions

  • How to fill out (display) values for several blocks in which there is no relationship between the blocks (tables).

    Hello.

    Is it possible to fill in the values (execute_query) several blocks where there is absolutely no relationship between the tables in the same form?

    There is no relationship between the tables. All are separate tables with different columns. None of the names of columns match

    & also the values of the columns do not match. I created blocks for all tables. When I click on run, only the first block of values (first picture) is filled.

    other values of block did not get filled. Is it possible to fill in the values for all of the blocks where there is not relationship, or when there is no master block?

    Is there something I can do for this? It is mandatory for me to put all the blocks in a single form.

    Help me, please. Please do not respond.

    Thank you.

    Create a key-EXEQRY-trigger on the block where 'throw you' the quers. In it, put something like

    GO_BLOCK ('BLOCK1');

    EXECUTE_QUERY;

    GO_BLOCK ('BLOCK2');

    EXECUTE_QUERY;

    ...

  • By using a WHERE clause in the tree APEX

    Hi all -

    I have a hierarchical SQL query that I display as a tree of the APEX.

    Here is my sample application:

    https://Apex.Oracle.com/pls/Apex/f?p=32581:29

    Login: guest

    PW: app_1000

    workspace: leppard

    I try to add a WHERE clause so that only nodes with the lowest-level children are displayed, i.e. something like "WHERE connect_by_isleaf = 0 OR level = 5'"

    The tree of query with where clause works very well in the SQL command window, but when I add the WHERE clause to my tree apex page no longer displays anything. Is this a problem with APEX or y at - it another way to filter my results?

    Thanks in advance for your suggestions,

    John

    Connect occurs in the first place, the where the provision is applied to these results, effectively cutting in the hierarchical structure. Since the apex has build a hierarchical structure of the query, it relies on the virtual level, which is butchered by applying the where clause. It's a miracle that you're not even receive errors because I expect almost an incorrect json array was built. With no top-level from and only level 5 or end nodes, there is no structure to present: the two apex cannot set a correct representation and not jstree neither. In your request, you will see your "root nodes", but it is not representable.

    I don't know why you want to present it in a tree? Levels both connect_by_is_leaf = 5 will give you everything just a list of nodes without any hierarchical structure.

    The best thing to do is to use a subquery to limit first your dataset and then use it for the basic tree query, this way you violate one of these vital columns.

    For example if you want only nodes and their immediate parent, you can opt for something like this (fast on some testdata model):

    with dataset as (
    select node_id, parent_id
       from treedata
      where connect_by_isleaf = 0
    connect by prior node_id = parent_id
      start with parent_id = 0
    ),
    dataset2 as (
    select node_id, parent_id
      from dataset
    union all
    select node_id, null parent_id
      from treedata
    where node_id in (select parent_id from dataset)
    )
    select level, node_id
       from dataset2
    connect by prior node_id = parent_id
      start with parent_id is null
    
  • Output query and alert if there is a duplicate between 2 tables

    I have 2 tables MembTableA and MembTableB. If a MemberNumber exist both ways, I want to somehow put an alert in my coldfusion output (I have an "CFIF" example in my code below) - and the only show 1 MemberTableA result. Here's my query and output - can anyone help?

    Application CFC

    SELECT dbo. MembTableA.MemberNumber, dbo. MembTableA.StatusCode, dbo.membTableB.Status

    FROM dbo. MembTableA LEFT OUTER JOIN

    dbo.membTableB ON dbo. MembTableA.MemberNumber = dbo.membTableB.MemberNumber

    Where dbo. MembTableA.status is null

    AND (dbo.) MembTableA.StatusCode) = < cfqueryparam value = "555" cfsqltype = "cf_sql_varchar" >

    or dbo.membTableB.Status = < cfqueryparam value = "999" cfsqltype = "cf_sql_varchar" >

    Exit on the page code

    < component cfinvoke =...

    method = "MemberNumberLst".

    returnvariable = "MemberNumberLst" >

    < table >

    < b >

    < /Th > < th > member number

    < /Th > < th > status code

    < /tr >

    < cfoutput query = "MemberNumberLst" >

    < b >

    < cfif MemberNumberLst.MemberNumber is both... >

    < td > #MemberNumber # * both * < table >

    < cfelse >

    < td > #MemberNumber # < table >

    < / cfif >

    < td > #StatusCode # < table >

    < /tr >

    < / cfoutput >

    < /table >

    earwig75,

    Since you are a left outer join, if there is a corresponding to MembTableB MemberNumber, you just need to check if the dbo.membTableB.MemberNumber column is not empty.  You will need to add the dbo. MembTableB.MemberNumber column to your SELECT statement.  However, because only the ColdFusion query results do not complete column names (i.e. dbo.membTableA.MemberNumber and dbo.membTableB.MemberNumber both will appear as MemberNumber), you can use an alias on this column.  In addition, if you use aliases on the names of tables, it will simplify the rest of your query.  Here is a cleaner version:

    SELECT tblB.MemberNumber as MemberNumberB, tblA.MemberNumber, tblA.StatusCode, tblB.Status

    FROM dbo. MembTableA AS tblA LEFT OUTER JOIN

    dbo.membTableB AS tblB ON tblA.MemberNumber = tblB.MemberNumber

    Where tblA.status IS NULL

    AND (tblA.StatusCode) =

    or tblB.Status =

    MemberNumber will always appear in MembTableA and sometimes only in MembTableB?  If so, then the modified query should work.  If the number may appear sometimes in MembTableA, or may appear in the MembTableB sometimes, then the query probably needs to be rethought.  If MemberNumber will always appear in MembTableA, then your might look like this:

    <>''>

    In addition, you can check the location of the brackets in your WHERE clause.  AND operators take precedence over OR operators, so this query will find documents when the tblA.status is null AND tblA.StatusCode is equal to '555' or records where tblB.Status is equal to "999".  Is it exactly what you want?

    HTH,

    -Carl V.

  • Is it possible to soften the transitions in a photo where the program automatically generates pixels that fall between two values of different color?

    Let's say you have an image with very harsh shadows or another type of abrupt changes in value. A domain is light, while the right of the box next to him has a darker value, without transition a lot in between. The values between the two are not enough to enjoy with the Clone Stamp tool. In addition, the smudge tool is not a desirable option because the results look too smooth and lacking in texture. Is there another way to soften the transition between these two areas involving Photoshop generation Pixel with a value that is between the sections of two colors?

    I don't think that you will never get good results. Reshooting with a proper lighting would be much easier, but here's an example of use of frequency separation. I duplicated the layer low pass and even more fuzzy then hidden in transition from shadow areas, as well as a few alterations on the high pass layer.

  • Left join between two tables using two different conditions

    I have following three tables with their data, as shown below.

    CREATE TABLE TIREMASTERPROCESS_TEMP
    (
    PRODUCTIONCODE TANK (12 BYTES),
    FIELDNAME CHAR (12 BYTES),
    DATACHR VARCHAR2 (60 BYTE),
    REVISIONNO TANK (3 BYTES),
    DATANUM NUMBER (9.4)
    )
    Whether the table c. and its sample data are like

    FIELDNAME DATACHR REVISIONNO DATANUM PRODUCTIONCODE
    AB No. Nch 1 100 0
    AB No. Nch 1 108 0
    AB No.-of-Nch 1 1 0
    Ass42 teased dishes 1 0
    Ass42 BTDrumNo1 BTD-051 1 0
    AB53 BTDrumNo1 BTD-051 104 0


    CREATE TABLE materialcode
    (
    UPPERMATERIALCODE CHAR (20),
    PROCESSNO TANK (3),
    PROCESSADOPTDATE TANK (9)

    )
    Whether the table b. and its sample data are like

    UPPERMATERIALCODE PROCESSNO PROCESSADOPTDATE
    Ass42 1 20120717
    AB53 108 20121121
    111 20111104 AS05
    104 20120928 AS30


    CREATE TABLE BUILDINGSCHEDULEMASTER
    (
    BUILDINGSIZE TANK (5 BYTES),
    GTCODE FLOAT (4 BYTES),
    TIREPERCART NUMBER (3.0).
    BUILDINGLOT NUMBER (3.0)
    )
    Whether table and its sample data are like

    BUILDINGSIZE GTCODE TIREPERCART BUILDINGLOT
    AB42A 4 12 ass42
    AB53A 4 88 AB53
    AS30A AS30 4 80
    BF03A 1 90 BF03


    Now, I need to get some data in these fields by using the suite of mappings.

    « PR_ » || Trim (a.BUILDINGSIZE) | ' / MPL2' Processid,--PRIMARY KEY
    TO_DATE (substr (NVL(b.PROCESSADOPTDATE,'19800101'), 7, 2) |) » /'|| SUBSTR (NVL(b.PROCESSADOPTDATE,'19800101'), 5, 2) | » /'|| SUBSTR (NVL(b.PROCESSADOPTDATE,'19800101'), 1, 4). (' 01:00:00 ',' dd-mm-yyyy hh24:mi:ss') starteff, to_date (SUBSTR (NVL(b.PROCESSADOPTDATE,'19800101'), 7, 2) |) » /'|| SUBSTR (NVL(b.PROCESSADOPTDATE,'19800101'), 5, 2) | » /'|| SUBSTR (NVL(b.PROCESSADOPTDATE,'19800101'), 1, 4). (' 01:00:00 ',' dd-mm-yyyy hh24:mi:ss') startDate.
    b.PROCESSNO revisioncodeid,
    a.BUILDINGLOT tirepercart ,
    CASE WHEN c.FIELDNAME = 'BTDrumNo1' then c.DATACHR end drumtype1.
    BOX WHEN (trim (C.DATACHR) = '1' and trim (C.FIELDNAME) = "No. Nch") and THEN click 'YES '.
    ANOTHER 'NO '.
    END may-BUG,
    case
    When c.FIELDNAME = 'Wavy'
    AND c.DATACHR = 'Use' THEN on 'YES '.
    When c.FIELDNAME = 'Wavy'
    AND c.DATACHR <>'Use' THEN 'NO '.
    fine wavy


    Now for the tables A and B I have the simple join as condition

    a.GTCODE = b.UPPERMATERIALCODE

    But I have to use two different left join conditions to join the table B and C to calculate the RESP fields according to the condition.
    Now, I have to use

    (trim (b.UPPERMATERIALCODE)). » -'|| Trim (b.PROCESSNO) = Trim (c.PRODUCTIONCODE) | » -'|| Trim (c.REVISIONNO)

    condition to get the data for the WAVY and DRUMTYPE1 fields.

    But at the same time, I have to use

    substr (Trim (b.UPPERMATERIALCODE), 1, 2). » -'|| Trim (b.PROCESSNO) = Trim (c.PRODUCTIONCODE) | » -'|| Trim (c.REVISIONNO)

    conition to derive the CHAFER field.

    And for this reason I am come so many duplicates and do not correct results for JUNEBUG, WAVY, DRUMTYPE1, and STARTDATE field.

    I need some advice as how can I do so that I get the correct results without duplicates for the PRIMARY KEY.

    Thank you

    Mahesh

    It would have been easier to answer if you gave us your example query that gives incorrect results - which both show us what you are doing and give us a starting point.
    Insert instructions for data, rather than only the data would have helped too, making it more quick to test this point.
    You do not show what you have done with your two outer join criteria, but I think you need to list TIREMASTERPROCESS_TEMP in your query twice, with alias names. Here's what I did:

    select a.BUILDINGSIZE, a.GTCODE, b.PROCESSNO ,  c1.FIELDNAME, c1.DATACHR, C2.FIELDNAME, C2.DATACHR
    , CASE WHEN c1.FIELDNAME='BTDrumNo1' then c1.DATACHR end drumtype1
    , CASE WHEN (trim(c2.DATACHR) = '1' and trim(c2.FIELDNAME) = 'No-of-Nch') THEN 'YES' ELSE 'NO' END CHAFER
    , case when c1.FIELDNAME='Wavy' AND c1.DATACHR='Use' THEN 'YES'
           when c1.FIELDNAME='Wavy' then 'NO' else null end wavy
    from BUILDINGSCHEDULEMASTER        A
    join materialcode b on a.GTCODE=b.UPPERMATERIALCODE
    left outer join TIREMASTERPROCESS_TEMP c1
       ON trim(b.UPPERMATERIALCODE)||'-'||trim(b.PROCESSNO) = trim(c1.PRODUCTIONCODE)||'-'||trim(c1.REVISIONNO)
    left outer join TIREMASTERPROCESS_TEMP c2
       ON substr(trim(b.UPPERMATERIALCODE),1,2)||'-'||trim(b.PROCESSNO) = trim(c2.PRODUCTIONCODE)||'-'||trim(c2.REVISIONNO)
    

    C1 is an alias for the TIREMASTERPROCESS_TEMP line which is necessary for drumtype1 and wavy, c2 is an alias for the TIREMASTERPROCESS_TEMP line required for JuneBug. There was some minor errors in your calculations of field I tried to correct.

    The results are:

    BUILD GTCO PRO FIELDNAME    DATACHR    FIELDNAME    DATACHR    DRUMTYPE1  CHA WAV
    ----- ---- --- ------------ ---------- ------------ ---------- ---------- --- ---
    AB53A AB53 108                         No-of-Nch    1                     YES
    AB42A AB42 1   BTDrumNo1    BTD-051    No-of-Nch    1          BTD-051    YES
    AB42A AB42 1   Wavy         NotUse     No-of-Nch    1                     YES NO
    AS30A AS30 104                                                            NO
    

    Hope this helps,
    David

  • How to use the instruction box in where clause

    Hi all


    I need to use cases where clause guide me please how I can do it.


    AND WHEN BOX: KAPCO = "KAPCO" THEN cla. CLASS_NAME LIKE '% KAPCO % '.
    WHEN: KAPCO = "NON_KAPCO" THEN SUPERIOR (cla. CLASS_NAME) NOT LIKE '% KAPCO % '.
    WHEN: KAPCO = 'ALL' GOLD: KAPCO IS NULL SO SUPERIOR (cla. CLASS_NAME) LIKE '% '.
    END



    Concerning

    Published by: user10941925 on March 4, 2012 22:31

    Hello

    CASE expressions return a single value, for example a VARCHAR2. They do refer to code fragments.

    You usually don't need (or want) an expression BOX in a WHERE clause, or any other condition. I think that you were trying to do the equivalent of:

    AND     (     (:KAPCO = 'KAPCO'          AND cla.CLASS_NAME       LIKE '%KAPCO%')     -- Don't you want UPPER on this line?
         OR     (:KAPCO = 'NON_KAPCO'           AND UPPER(cla.CLASS_NAME) NOT LIKE '%KAPCO%')
         OR     (NVL (:KAPCO, 'ALL') = 'ALL'       AND cla.CLASS_NAME IS NOT NULL)
         )
    

    If you would care to post some sample data (CREATE TABLE and INSERT statements) and the results desired from this data, I was able to test this.

  • Cannot run a «BUSINESS...» WHEN ' with a date in a WHERE CLAUSE condition

    Hello

    I need to check for a condition and date according to the date, he would check a set of host names or the other game... so I thought I could write something like this in the WHERE clause:

    AND HOST_NAME IN

    (

    CASE

    WHEN TO_DATE (: StopDate, 'MON-DD-YYYY') > = TO_DATE ('22 - DEC - 2015 "," DD-MON-YYYY ') THEN

    ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC') ON THE OTHER

    ("SERVERNAME1", "NAMESERVER2", "SERVERNAME3")

    END

    )

    I get the following:

    ORA-00907: lack of right parenthesis

    00907 00000 - "lack the right parenthesis.

    But there is no missing parentheses!

    If I take the case... when... end, and run the host_name in ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC') (separately, they run fine)...

    I also tried:

    AND

    (

    CASE

    WHEN TO_DATE (: StopDate, 'MON-DD-YYYY') > = TO_DATE ('22 - DEC - 2015 "," DD-MON-YYYY ') THEN

    HOST_NAME IN ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC') ELSE

    HOST_NAME IN ('SERVERNAME1","NAMESERVER2","SERVERNAME3")

    END

    )

    the error I get is:

    ORA-00905: lack of keyword

    00905 00000 - 'lack the key word'

    What keyword miss me?

    Post edited by: c75d2e42-06a0-4eb1-a576-5652edcbfbe8

    Hello

    c75d2e42-06a0-4eb1-A576-5652edcbfbe8 wrote:

    It was a typo when transferred to the Oracle forum... the version of Oracle is: PL/SQL version 10.2.0.3.0 (10 G)

    I also used IF the statement and that has not worked (in error "missing parenthesis") which I'm sure is a matter of "syntax"... I did not know that the CASE statement returns the value single only, so it's probably the problem.  Is it possible to re - write this?

    ...

    IF only works in PL/SQL.  It does not in SQL, even if that SQL is embedded in PL/SQL.

    There are many ways to re - write the condition.  And here's one:

    AND ((host_name IN ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC')

    AND TO_DATE (: StopDate, "MON-DD-YYYY") > = TO_DATE ('22-DEC-2015', "MON-DD-YYYY")

    )

    OR (host_name IN ('servername1","Nameserver2","SERVERNAME3")

    AND TO_DATE (: StopDate, "MON-DD-YYYY")<  to_date="" ('dec-22-2015', ="">

    )

    )

    If: StopDate can be NULL, it must be a bit more complicated.

    You can also use nested, such as CASE expressions

    AND THE CASE

    WHEN TO_DATE (: StopDate, "MON-DD-YYYY") > = TO_DATE ('22-DEC-2015', "MON-DD-YYYY")

    WHILE CASE

    WHEN host_name IN ('SERVERNAMEA', 'SERVERNAMEB', 'SERVERNAMEC')

    AND THEN 'OK '.

    END

    OTHER CASES

    WHEN host_name IN ('servername1","Nameserver2","SERVERNAME3")

    AND THEN 'OK '.

    END

    END = 'OK '.

    I wonder if this in your application is the best way, however.  If SERVERNAMEA was put into service on December 22, maybe that that fact should be recorded in a table.  If you have a table with 1 row per server, you can consider adding 2 columns DATE to show when the server was first and last used.  Then, rather than use a WHERE clause to test servers appropriate, you could do an inner join.

  • Setting of outsourcing work is not for a SQL Where clause

    Im trying to outsource the WHERE SQL clause of a snapshot data (connecting to Siebel DB) and specify where clause in the run profile that does not work.

    Snapshot of research: Select the name of siebel.s_org_ext

    Parameter of outsourcing: where_clause_sql

    Run the content of the profile:

    phase. Phase1.snapshot.clt.where_clause_sql = name = "ABC0009".

    #phase. Phase1.snapshot.clt.snapshot_sql = select name from siebel.s_org_ext where name = 'ABC0009 '.

    The above parameter retrieves all the records in the table. Below the profile execution retrieves just this record that seems to work fine.


    Run the content of the profile:

    phase. Phase1.snapshot.clt.snapshot_sql = select name from siebel.s_org_ext where name = 'ABC0009 '.


    I want to outsource only where clause as there are many SQL and they are huge to maintain in the run profile.

    I have attached a doco with screenshots that will help to understand more.

    Hello

    You must BE

    -Choose "Select table or view" in the table of the snapshot Wizard selection page

    &

    -Use outsourced where clause

    OR

    -Choose "SQL" in the snapshot table selection wizard page.

    &

    -Outsourced use SQL snapshot

    You can't mix and match options.

    Kind regards

    Nick

  • NULL columns in where clause

    Hello
    I use a table column in the where condition.
    For example. product_id <>1234 in where clause.
    and the query returns results which have id is not equal to 1234.

    My question is if the product id for a particular set (row) record is null, then only this record show upward in the result because it is not equal to 1234.

    In other words oracle made the comparison "<>null 1234 so retunr the record in the result set?

    Please advice. Thanks in advance.

    Hello

    No Oracle would not return columns with null values if this column is used in where clause with equal/not equal clause (= /! =)
    If there use null values in query

    where (product_id != 1234 or product_id is null)
    

    Concerning
    Anurag

  • several conditional parameters in where clause

    How to select records in a table, when I say emp, a parameter for where the condition as
    If empno is known then use in where clause,
    If ename is known then use ename in where clause,
    If both are known then use two parameters in where clause.

    I use Oracle 9i.
    psuedo code.
    ...
    if p_empno is not null and p_ename is not null then
    select * from emp 
    where empno=p_emp and ename = p_ename ;
    elsif p_empno is null and p_ename is not null then
    select * from emp 
    where ename = p_ename ;
    elsif p_empno is not null p_ename is null then
    select * from emp 
    where empno=p_emp ;
    else 
    select * from emp 
    end if ;
    ...
    How can I do this in sql and plsql


    Thank you

    Published by: user10999538 on July 15, 2009 03:29

    Solution

    SELECT *
    FROM   emp
    WHERE  Nvl(empno,-9999) = Coalesce(p_empno,empno,-9999)
           AND Nvl(ename,'X') = Coalesce(p_ename,ename,'X')
    /
     
    

    SS

  • Using the built-in function in the definition of the relationship between the two blocs.

    Hello
    Is it possible to define a relationship between two shaped blocks (db based)...
    I have a main table such as:
    Table: strdet (passes: ms varchar2 (10), det varchar2 (10))
    materialized view: mv (passes: det varchar2 (10), sum_a number (5), sum_b number (5))
    and data:
    strdet
    -------------------------
    ms                   det
    1                     1.1
    1                     1.2
    1.1                  1.1.1
    1.1                  1.1.2
    1.1.1               1.1.1.1
    ....
    e.t.c.

    and for the mv
    --------------------------
    det               sum_a     sum_b
    1                   500        300
    1.1                100        200
    1.2                540        150
    ................
    e.t.c.

    I have tried some versions of relations so as to create a master-detail relation(in reality , the two blocks are connected via ms.det
    ->mv.det...  but the relation is one-to-one....) . I want a result such as:

    Master block
    ------------------------------
    1.1

    Detail Block
    ------------------------------
    1.1.1
    1.1.2
    ....
    e.t.c.
    Is it possible somehow?

    Note: I use Dev6i and Dev10g...

    Thank you
    SIM

    I think you need to use a query clause for the retail block. If you join the main table and the mv on the DET column, so you can give each line in detail, block a MS (from the main table) column that you can use in the relationship.

  • SQL join on the two tables where the column as another column

    Hi all


    tried to get the results of a join between two tables where only one column is like another.

    Table1 (nameA) examples: black2, green1

    Table2 (Name) example: black2.location.uk.com, green1.location.uk.com

    so, for example, I want to match all those in table1 with black2 column in table2 that begins with black2 and so of suite, if you see what im trying to get to!

    My sql up to now:
    select * from  schema.table1 a
    join schema.table2 b 
    on a.nameA like concat('%', b.nameB, '%'); 
    but it errors:

    ORA-00909: invalid number of arguments
    00909 00000 - "invalid number of arguments.

    Any help or advice would be greatly appreciated, thank you!

    Or any of them should do...

    select * from  schema.table1 a
    join schema.table2 b on a.nameA like '%'||b.nameB||'%';
    

    or

    select * from  schema.table1 a
    join schema.table2 b on instr(b.nameB,a.nameA) > 0
    
  • Order columns (which make up the primary key constraint) matter in where clause of DML query for use of indexing mechanism to operate.

    Version of DB: database Oracle 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production


    I have a table my_table as below:
    create table my_table
    (
    my_code varchar2 (6).
    my_id varchar2 (24).
    forced pk_1 primary key (my_code, my_id)
    );


    Primary_key here's a composite key that contains columns 1 (my_code) and 2 (my_id).
    Is there that a difference in the way below queries is executed in terms of performance (use of indexing in the extraction).

    (a) select * from my_table where my_code = '123' and my_id = "456";
    (b) select * from my_table where my_id = '456' and my_code = '123';


    The understanding I have the order of the column in the where clause should be identical to the sequence in
    What primary key draws for indexing to be used by oracle in oracle other DML queries ignores indexing
    However when I used explain plain both show the same query cost with single scan with index rowid.
    so I don't know if I'm wrong in the concept that I have. Kindly help.

    Thanks in advance,
    Gerard

    Your question is answered in the Performance Tuning Guide

    Using indexes and clusters

    14.1.4 choosing composite indexes

    A composite index contains several key columns. Composite indexes can provide additional benefits compared to the index to single column:

    • Improved selectivity

      Sometimes the two or more columns or expressions, each with a low selectivity can be combined to form a composite with a high selectivity.

    • Reduced IO

      If all columns selected by a query are a composite index, then Oracle may return these values in the index without access to the table.

    A SQL statement can use a path on a composite index if the statement contains constructions that use a main part of the index.

    Note:

    This is no longer the case with the skip index scans. See "Index Skip Scans".

    A main part of an index is a set of one or more columns that have been specified first and consecutively in the list of columns in the CREATE INDEX statement that created the index.

  • Can I use truncated and where clause in the statement even?

    Hello guys,.

    Can I use truncated with where clause in the same statement.


    For ex:

    TRUNCATE TABLE my_table WHERE id < 500;

    If not, that you recommend me to overtemperature to the level of high water line?


    By the way
    select * from v$version;
    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE 11.2.0.1.0 Production."
    AMT for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    >

    Thank you very much.

    Published by: 970992 on 11:14 13.Ara.2012

    >
    Okay I need an increasing amount of space. However, at the same time I want to recover the spaces empty below HWM. So, I need to use less amount of space I am inserting. Therefore, shouldn't use retractable for this?
    >
    Why waste the effort. Oracle will reuse the space below the HWM when doing inserts. You already said that you insert more lines you delete so all these will be more accustomed to the top.

    The only time where that oracle may not use space is when the space is too small to be useful. It is documented in the doc, I told you
    >
    Understanding recoverable unused space
    Over time, Update, and Delete on objects within a tablespace can create pockets of empty space that individually are not large enough to be reused for the new data.
    >
    Most uses of CONTRACTION I've seen are totally useless. If you follow the doc and run the Advisor of segment it will tell you if there is space that can be retrieved and how much. But, even once, for your use even if case will get you will Oracle while you need to reassign the new extensions, then the HWM will just go still higher.

    If pay you a heavy price in Oracle did a full table scan, update of many blocks from the table, update THE index, impact performance for other users to access the table during the SHRINK and reallocate extensions (maybe even some of the same areas) when you insert more data.

    Do not SHRINK unless you know it's necessary.

Maybe you are looking for

  • Example usage of CaptionSource_MacroExpression anywhere?

    I use Visual c# to develop a custom user interface and I'm trying to understand how to move an expression of format (IE. "% ProgressTextLongName % ProgressPercentLongName %') using CaptionSources.CaptionSource_MacroExpression" Method of ConnectCaptio

  • Call dll ActiveX in Labview

    Hello I'm a new starter in c# .net.  I have a control dll ActiveX (control of vision of NOR -> CWIMAQ). I need to call dll functions in Labview. I searched for articles on this subject. Everyone talks about single thread and register the dll.  I have

  • Synaptics Touchpad is sensitive to

    I just had my presario CQ57-319WM 7 software reinstalled windows.    The problem is when I try to type on the keyboard and I touch the keyboard, the cursor will move.   I went into the control panel mouse and there is no entry for the touchpad.   I i

  • No audio, cd/dvd devices does not work, can not update via Microsoft Update, usb memory sticks not recognized and much more

    The initial problem was no audio sound on CD.  The computer had other system sounds.  I uninstalled the Realtek drivers and downloaded from the website computer and reinstalled.  Still the same problem. I tried to adjust the volume control and clicke

  • The boot does not work

    When I went to "reactivate" the computer and the monitor; a message from the monitor No Signal appears even you the computer is on.  I have to restart to get into the computer. I went the fix it Center and it's even a little weird.