Selection of several Tables, but requiring data based on a table in the 3rd

Hi all

I'm having a lot of trouble with this selection

I have three tables:
 prod_poured, conc_test, and cyl_break
To set up my report, I need to recover these data:
cyl_break.pour_no "Pour Number", cyl_break.cyl_id "Cylinder ID", cyl_break.pour_d "Pour Date", conc_test.mix "Mix #", conc_test.amb_t "Ambient Temperature", conc_test.conc_t "Concrete Temperature", conc_test.air "Air %", cyl_break.break_d "Break Date", cyl_break.age "Age (Days)", cyl_break.spec_str "Specified Strength", cyl_break.str "Specimen Strength"
and I need to enter all the data from these two tables when a column in the prod_poured table meets a certain condition

That's what I have so far:
select cyl_break.pour_no "Pour Number", cyl_break.cyl_id "Cylinder ID", cyl_break.pour_d "Pour Date", conc_test.mix "Mix #", conc_test.amb_t "Ambient Temperature", conc_test.conc_t "Concrete Temperature", conc_test.air "Air %", cyl_break.break_d "Break Date", cyl_break.age "Age (Days)", cyl_break.spec_str "Specified Strength", cyl_break.str "Specimen Strength"
from conc_test inner join cyl_break on conc_test.pour_no = cyl_break.pour_no, prod_poured
where conc_test.pour_no = prod_poured.test_id and prod_poured.job_no = '9-12-821';
It gives me good results but wayyy too many of them so obviously, that I got something wrong.

the results it gives are this:
Pour Number     Cylinder ID     Pour Date     Mix #     Ambient Temperature     Concrete Temperature     Air %     Break Date     Age (Days)     Specified Strength     Specimen Strength
100322A     100322A3     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.6
100322A     100322A3     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.6
100322A     100322A3     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.6
100322A     100322A3     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.6
100322A     100322A3     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.6
100322A     100322A3     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.6
100322A     100322A3     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.6
100322A     100322A3     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.6
100322A     100322A3     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.6
100322A     100322A4     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.4
100322A     100322A4     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.4
100322A     100322A4     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.4
100322A     100322A4     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.4
100322A     100322A4     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.4
100322A     100322A4     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.4
100322A     100322A4     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.4
100322A     100322A4     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.4
100322A     100322A4     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.4
100324A     100324A3     24-MAR-10     10     9     15     5.8     21-APR-10     28     35     51.9
100324A     100324A3     24-MAR-10     10     9     15     5.8     21-APR-10     28     35     51.9
100324A     100324A3     24-MAR-10     10     9     15     5.8     21-APR-10     28     35     51.9
100324A     100324A3     24-MAR-10     10     9     15     5.8     21-APR-10     28     35     51.9
100324A     100324A4     24-MAR-10     10     9     15     5.8     21-APR-10     28     35     50.8
100324A     100324A4     24-MAR-10     10     9     15     5.8     21-APR-10     28     35     50.8
100324A     100324A4     24-MAR-10     10     9     15     5.8     21-APR-10     28     35     50.8
100324A     100324A4     24-MAR-10     10     9     15     5.8     21-APR-10     28     35     50.8
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
100324E     100324E3     24-MAR-10     10     10     15     6     21-APR-10     28     35     50.7
100324E     100324E3     24-MAR-10     10     10     15     6     21-APR-10     28     35     50.7
100324E     100324E3     24-MAR-10     10     10     15     6     21-APR-10     28     35     50.7
100324E     100324E3     24-MAR-10     10     10     15     6     21-APR-10     28     35     50.7
100324E     100324E3     24-MAR-10     10     10     15     6     21-APR-10     28     35     50.7
100324E     100324E4     24-MAR-10     10     10     15     6     21-APR-10     28     35     51.6
100324E     100324E4     24-MAR-10     10     10     15     6     21-APR-10     28     35     51.6
100324E     100324E4     24-MAR-10     10     10     15     6     21-APR-10     28     35     51.6
100324E     100324E4     24-MAR-10     10     10     15     6     21-APR-10     28     35     51.6
100324E     100324E4     24-MAR-10     10     10     15     6     21-APR-10     28     35     51.6
The results that I need to give is this:
100322A     100322A3     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.6
100322A     100322A4     22-MAR-10     10     16     16     4.2     19-APR-10     28     35     50.4
100324A     100324A3     24-MAR-10     10     9     15     5.8     21-APR-10     28     35     51.9
100324A     100324A4     24-MAR-10     10     9     15     5.8     21-APR-10     28     35     50.8
100324E     100324E3     24-MAR-10     10     10     15     6     21-APR-10     28     35     50.7
100324E     100324E4     24-MAR-10     10     10     15     6     21-APR-10     28     35     51.6
100326B     100326B3     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     48.3
100326B     100326B4     26-MAR-10     10     9     15     5.7     23-APR-10     28     35     49
As you can see it my query provides good results, just too much of them. I just need to have a result by cylinder id.

I can't seem to wrap my mind around this and if someone could set up a proper selection based on what I need which would be extremely useful. If you need to any more data to provide a help just ask and I'll stick it.

Thank you

DTR

Published by: DB on April 26, 2010 11:12

Hello

Whenever you have a problem, post a small example of data (CREATE TABLE and INSERT statements) for all the tables involved, so people can recreate the problem and test their solutions.

There is a one-to-many relationship between conc_test and prod_poured? In other words, can there be several lines of prod_poured all with the same test_id?
If so, you probably don't want to join prod_poured; one EXISTS or IN Sub query instead.
For example:

select  cyl_break.pour_no     "Pour Number"
,     ...               -- other columns, as you already have them
from         conc_test
inner join     cyl_break     on     conc_test.pour_no = cyl_break.pour_no
where   conc_test.pour_no     IN (  SELECT  test_id
                          FROM    prod_poured
                          WHERE   job_no     = '9-12-821'
                       )
;

No doubt someone will suggest that say you SELECT DISTINCT to remove duplicate rows. This is inefficient; It is best not to get the first duplicate lines.

Tags: Database

Similar Questions

  • I downloaded the creative application of cloud to desktop. I tried to install it several times, but each time when it is at halfway, the installation is complete.

    I downloaded the creative application of cloud to desktop. I tried to install it several times, but each time when it is at halfway, the installation is complete.

    Windows:

    (1) open the c: drive and navigate to C:\Program Files (x 86) \Common Files\Adobe.

    Open the Adobe folder and delete folders named Adobe Application Manager and OOBE.

    ------------------------------------------------------------------------------------------ ---------------------

    2) navigate to C:\Program Files (x 86) \Adobe.

    Open the Adobe folder and if necessary remove Adobe Creative Cloud folder.

    Then try to install the creative cloud application: https://creative.adobe.com/products/creative-cloud

    ------------------------------------------------------------------------------------------ ---------------------

    Mac:

    1) click on the Finder and search options listed next to icon located Apple in the upper left of the screen and click on the "Go" menu button and select 'utilities '.

    (Applications > Utiliites)

    Look for a CC Adobe and Adobe Application Manager folder under utility window and trash both folders.

    2)

    Click on the link below and download & run the cleaning of Adobe tool:

    Select "Adobe Application Manager for Mac OS X 10.6 ' and then click on"Clean up selected. "

    https://helpx.Adobe.com/content/help/en/Creative-Suite/KB/CS5-cleaner-tool-installation-PR on-item-par/procedure/proc_par/step_3/step_par/download/file.res/AdobeCreativeCloudCleaner oblems/_jcr_content/hand-Sea/accordion_container_1/accordion-nominal/accordion-point-1/accordi Tool.zip

    (3) then try to install the creative cloud application: https://creative.adobe.com/products/creative-cloud

  • GRANT SELECT on a table to the user / role changes for the tab last_DDL

    Hello

    Is grant select (or any private object) to the user/role a DDL statement?

    GRANT SELECT on a table to the user / role changes the last_DDL to the table.
    1 > is this expected behavior?
    2 > no way in which we can grant select on a table by another user, without changing the DDL? (for example create view).


    The test is performed:

    Prior to the issuance:


    OBJECT_NAME CREATED TIMESTAMP LAST_DDL_TIME OWNER
    ------- ---------------------- ---------- ------------- --------------------
    AR HZ_CUSTOMER_PROFILES 8 MAY 00 13 MARCH 13 2003-06 - 26:12:41:29



    Grant statement:
    GRANT SELECT ON "AR". "' HZ_CUSTOMER_PROFILES ' TO 'AR_VIEW ';

    Note: AR_VIEW is a role, I tried granting also directly to the user.


    After the grant:

    OBJECT_NAME CREATED TIMESTAMP LAST_DDL_TIME OWNER
    ------- ---------------------- ---------- ------------- --------------------
    AR HZ_CUSTOMER_PROFILES 8 MAY 00 21 MARCH 13 2003-06 - 26:12:41:29



    Old thread, discuss whether Grant is DDL or not, but no documented conclusions.
    ( Re: Grant, revoke is DDL and DCL? )

    Please help in the assessment above.

    -Best regards,.
    Mani

    It's the DOF.

    After all, this isn't DML, it implicitly committed and you cannot use it directly in PL/SQL: features of DDL. :-)

  • I followed these steps several times, but he still has to work to rebuild the index.  Is there something else in the way of this work?

    Have you tried to rebuild the index spotlight several times, but it didn't work. I followed the steps through the system preferences, but there is no result for the rebuilding of the index.  Is there another way to do it, or is there another problem preventing it from working?

    Do you mean the following steps:

    Rebuild the index on your Mac - Apple Support Spotlight

  • Is it possible to create a shuttle component in Oracle ADF, where the available and selected lists are tables of the adf?

    Hi all


    We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


    Is it possible to create a shuttle component in Oracle ADF, where the available and selected lists are tables of the adf?



    I did a POC sample on it. I can share with you. I can't put in my dropbox because dropbox is blocked in my network. Share your email. I'll send the POC through

  • I installed camera raw which supports photoshop cs5 several times, but why I'm not able to find the raw camera filter menu Filter?

    I installed camera raw which supports photoshop cs5 several times, but why I'm not able to find the raw camera filter menu Filter

    Hi sharathm,

    Greetings!

    Camera filter gross was not with photoshop CS5.

    You have installed the camera raw plugin and not filter raw from the camera.

    You can open files in camera raw using of bridge or just right click on the image and choose open in camera raw.

    Check out this video here: https://www.youtube.com/watch?v=UKJuUC9_XUg

    Concerning

    Jitendra

  • expdp + query option to export from several tables with the same condition

    Hello

    We want to export a subset of data only from databases to another. Both on AIX.

    Source/testdatabase 11.2.0.3 (non partitioned tables)
    Target productiion 11.2.0.3 database (separate tables)

    Tables of same names of columns but diffrenet structures a partitioning index and traget so only want to import content

    Each source datbaase hascolumn seq number table and want only to extract the last months of data.


    TABLES:table1,table2...
    DUMPFILE=dump_dir
    CONTENT=data_only
    QUERY= table1:"WHERE seq_num >100 "
    want to use expdp but not sure how to make sure that all tables have the seq_num WHERE > 100 condition, if let table1: go out and have just
    QUERY = "WHERE seq_num > 100"this condition would apply to all tables that we want."


    I'm assuming that can also use impdp CONTENT = data_only?

    Any ideas/thoughts?

    Thank you

    QUERY = "WHERE seq_num > 100"this condition would apply to all tables that we want."

    Yes, it will work for all tables, but ensure that all exported table must include this column.

    QUERY
    Default: no
    Goal
    Allows you to filter the data that is exported by specifying a clause of a SQL SELECT statement, which is applied to all tables in the work of export or a specific table.

    The query_clause is usually a WHERE clause for the selection of refined lines, but could be any SQL clause. For example, an ORDER BY clause can be used to accelerate a migration from a table in a heap in a table held in index. * If a [schema]. table_name is not provided, the query is applied to (and must be valid for) all tables in the export job.*

    http://docs.Oracle.com/CD/B19306_01/server.102/b14215/dp_export.htm

  • SELECT on a table in the INSERT statement uses the INDEX

    Hello world

    I have a strange problem with EA Oracle 10 g (64-bit) running on a Linux system. The situation is, I developed a Java program to migrate one client system to another. One of the steps in the migration fills a new table with the data from the old system. Given that the data on the old system structure is fundamentally different from that new, I have to check each time I read a line from the old system, if I have already created an entity on the new table, and if so, update certain attributes. The WHERE clause of this audit uses a key of the company indexed on the new table. The problem is now, that Oracle does not use the index on the key attribute of the company, but it makes table scans complete to select the line. As you can imagine, the lines first thousand or so go fast, but the amount increases, the program becomes slower and slower.

    If I do a "scan" when executing the migration program, Oracle change the execution plan and use the index on the attribute key and everything works fast and smooth. However, if I do the analysis on the empty table first, nothing changes (which I understand it perfectly, since there is nothing to analyze, at this point). By integrating a hint of 'INDEX' (table) in the statement SELECT does not change the full implementation plan (also table scans).

    Is it possible to change this behavior, in order to SELECT it uses the index of key business from the beginning?

    Greetings from Cologne,

    Thorsten.

    Published by: thkitz on 13.03.2012 18:27

    thkitz wrote:

    SELECT STATEMENT  ALL_ROWSCost: 2  Bytes: 76  Cardinality: 2
         7 TABLE ACCESS BY INDEX ROWID TABLE AIDATINT.PRVVSSCHADENKORRESPONDENZ Cost: 2  Bytes: 76  Cardinality: 2
              6 BITMAP CONVERSION TO ROWIDS
                   5 BITMAP OR
                        2 BITMAP CONVERSION FROM ROWIDS
                             1 INDEX RANGE SCAN INDEX AIDATINT.I_PRVVSSCHADENKORRESPONDENZ_1 Cost: 1
                        4 BITMAP CONVERSION FROM ROWIDS
                             3 INDEX RANGE SCAN INDEX AIDATINT.I_PRVVSSCHADENKORRESPONDENZ_2 Cost: 1  
    

    I would have thought that as a plan as possible. It is not a concatenation, is a btree/bitmap conversion.
    Allude to this plan you need / * + index_combine (table_alias index1 index2) * /.
    For 10g and later the index can be specified by name or by description

    I'm a bit puzzled why the plan changes after truncate - but maybe my comment about not cleared statistics is no longer true. It is easy enough to check if I'm right or wrong on your version of Oracle.

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    Author: core Oracle

  • Access to several tables to the user

    Hi forum members,

    Am an Oracle, PL/SQl newbie. A request came from the customer. There is a database with two other user/schema - ABC and XYZ.

    Each scheme has its own set of tables.

    Now, our customer wants to access (select access only) all tables from a diagram of the ABC XYZ scheme. Now, there are a more than 200 tables in the schema XYZ, where his bulky to run as the same grant the select query again and again. Could someone help me with a query that would do the work at once?

    NB:client connects the two schemas, using only the users of ABC and XYZ.

    Oracle-11 g

    Thank you very much

    Published by: user1128836 on May 18, 2012 02:31

    Hello

    run these instructions with the user that you want to access:

    set linesize 2000 pagesize 999999999 echo off feed off hea off
    select 'GRANT SELECT ON XYZ.'||table_name||' TO ABC;' from user_tables where table_name not like 'SYS_NT%'
    

    You can then copy and run the output.

  • granting of privileges to the schema for several tables at the same time... any script?

    Hello gurus,

    I have about 25 tables in the ABC scheme

    I want to give all privialges to the XYZ schema for all tables of 25 which is in the pattern ABC... So is there is SQL statement or a script, I can run to grant privileges to all tables.

    Something similar to these...

      SELECT 'create synonym ' || table_name || ' for ' || table_name
      FROM user_tables  {code}
     
    So i get all the table names ....then i can run as a script.... U r help is greatly appriciated gurus!!!
    
    
    Thank you!!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Administrator:

    set head off
    set pages 0
    set feed off
    spool myscript.sql
    Select 'grant select, insert, update, delete on abc.'||table_name||' to xyz;'
      from dba_tables
     where owner = 'ABC';
    
    Select 'create synonym xyz.'||table_name||' for abc.'||table_name||';'
      from dba_tables
     where owner = 'ABC';
    
    spool off;
    

    Obviously this does not all new table that will be created in the future on ABC schema...

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

  • Select from several tables

    I have 3 tables in my database...

    Table1 with one column

    Table1:
    table1_id
    11
    12
    13
    14

    Table2 with a single column

    Table2
    table2_id
    21
    22
    23
    24

    Table 3 with 2 primary foreign keys of table1 and table2

    Table 3
    table1_id table2_id
    11 21
    11 22
    12 23
    12 24
    13 21
    14 22


    I want a select statement that selects everything in table2 where the specified table1_id is not in the list of the table1_id in table 3

    for example if I want the list of 11 IDs it should return (23, 24)

    I came up with the following, but it didn't work

    Select table2_id
    of tabel3 c, table2 b
    where table1_id <>11 and c.table2_id = b.table2_id


    I know that my explanation is not clear...
    but any effort will be appreciated

    That should do it. I have not create the tables, therefore not tested.

    SELECT t3.table2_id
    FROM   table_2 t2
           INNER JOIN table3 t3
           ON t2.table2_id = t3.table2_id
    MINUS
    SELECT t3.table2_id
    FROM   table_1 t1
           INNER JOIN table3 t3
           ON t1.table1_id = t3.table1_id
    
  • Line layout selection/evidence code table of the adf

    Hi all

    I use Jdev12c and you want to programmatically select a row in a table. It's the line should be highlighted and the graph of the child should also be updated to the selected line. If I can get one of these features that is also sufficient.

    I have DCIteratorBinding instance for the table, but do not receive good method/how to get there. The size of table is 20.

    Thank you!

    viewObject.setCurrentRow (row); did not work for me it turns that I greeted the multipleSelection on the table and this is the main reason for which even after refresh of the VO of the selection of some random lines in the main table is not removed even if detail table/chart refreshes to display the data corresponding to the first line of the main table.

    So I removed the selection of the main table (using following code) gives me the very view that when the page is loaded first time (i.e. no line selected in the child master and graph/table table were given corresponding to the first row in the main table).

            UIComponent component = JSFUtils.findComponentInRoot (tableId);
            If (component instanceof richeTableau) {}
                Table richeTableau = component (richeTableau);
                Set of rows RowKeySet = table.getSelectedRowKeys ();
                rowSet.clear ();
                System.out.println ("removed from the line selection table:" + tableId);
  • Select from another table, when the query returns no result

    Hello

    I have a question where I'm supposed to retrieve the address of an account id-based billing. However, the table of billing may not have an address. There is a table of addresses that always has an address for an account. If the billing address exists, it should be used, so I can't use the address table. Is it possible in a select statement to query to the billing address and if it does not exist, use the address table.

    SELECT * FROM accounts a, b billings WHERE a.accountid = b.accountid

    Any help will be greatly appreciated.

    Thank you.

    user10407139 wrote:
    Hello

    I have a question where I'm supposed to retrieve the address of an account id-based billing. However, the table of billing may not have an address. There is a table of addresses that always has an address for an account. If the billing address exists, it should be used, so I can't use the address table. Is it possible in a select statement to query to the billing address and if it does not exist, use the address table.

    SELECT * FROM accounts a, b billings WHERE a.accountid = b.accountid

    Any help will be greatly appreciated.

    I think you need to explain more clearly if

    -you only have a couple of "billing" columns which is empty and in this case, you want to use the columns from the table 'accounts '.

    - or you have a join with another table that doesn't return data, for example a foreign key "address_id" "billing" is zero and therefore the join to other tables 'address' will return all the data

    In the first case, you have already been provided with some examples here, how to use NVL or similar functions to achieve, even if the first post first evaluates the information of 'accounts' and if it is white using information from "billing". According to your description you need the other way around. The second post a subquery recursive useless in my opinion.

    In the latter case, you should probably use an "outer" join so that the data in your table "bills" are returned, even if the join to another table is not at all the lines.

    SELECT
    NVL(AD1.ADDRESS_ATTR1, AD2.ADDRESS_ATTR1) as ADDRESS_ATTR1,
    NVL(AD1.ADDRESS_ATTR2, AD2.ADDRESS_ATTR2) as ADDRESS_ATTR2,
    NVL(AD1.ADDRESS_STREET, AD2.ADDRESS_STREET) as ADDRESS_STREET,
    ...
    FROM accounts a
    INNER JOIN billings b
    ON a.accountid = b.accountid
    LEFT OUTER JOIN address ad1
    ON b.address_id = ad1.address_id
    INNER JOIN address ad2
    ON a.address_id = ad2.address_id;
    

    In this way you pick up the address stored in the "invoices" table, if it existed, otherwise you pick up the address assigned to the "accounts" table I used an inner for the second address join join because you said that the account always has an assigned address.

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

  • How to capture the event of selection of a table on the side line client (JavaScript)

    The example is:
    < af:table >
    < af:column >
    < af:outputText... >
    < af:clientListener... / >
    < /... >
    < /... >

    However, the text does not fill to the top of the cell. So, if I click on the on the empty area, the event handler is not called.
    I hope, even if I click on the empty area of the line, the event handler will be called.
    In fact, if I click on a row of a table at any location, including the empty area, the line becomes blue. How to capture this select event row on the client side?

    You can try file the client listener as a child under tag instead of the ?

    
    ...
    
    
    
    

    The above code should call a function in your js file called "handleTableDoubleClick", which, in turn, queued a ClientEvent that can be attached to a Backing Bean method. Something like:

    ...
        public void handleTableDoubleClick(ClientEvent ce) {
           //do something when the table is double clicked.
        }
    ...
    

    hope that helps

  • Performance in the treatment of the based on a game, several tables from target

    Welcome.

    I have question about a treatment based on a game, when mapping have several tables in the target. I noticed that OWB generate SQL code that usually build a query for each table in the target insertion. Suggest that each table has results from different stages of the treatment, so multi table insert cannot be used. Looking for generated code PL/SQL, I feel that each insert query managed independently and so each make analyses of source table and joins on its own.
    To make my question more concrete, I will introduce two simple examples of stream ETL:
    1) start-> (table scan)--> (joins)--> (inserting into the table t1)
    2) start-> (table scan)--> (joins)-> two targets: (insert into table t1)
    -> two targets: (deduplicator)--> (insertion in table t2)
    Admit, that scans and joins are very expensive comparing to insert rows. Thus, it is usually, if oracle performs scans of tables 2 and joined in example 2) and example 2) take twice longer than example 1)?
    Or fact Oracle is so smart that it can cache the result of entering the first query and use it again in the second query?

    Best regards
    Pawel

    Hi Pawel,

    Thus, it is usually, if oracle performs scans of tables 2 and joined in example 2) and example 2) take twice longer than example 1)?

    Yes, you are right

    Or fact Oracle is so smart that it can cache the result of entering the first query and use it again in the second query?

    Nor the database Oracle or OWB don't is not to intermediate capabilities query result caching.
    While the Oracle database feature "result cache queries", but it must match exactly to SQL source and it store only the final query result...

    Kind regards
    Oleg

Maybe you are looking for

  • Since the FF13 update news FEED stopped loading/updating!

    Had heard a report on it and I had the same problem immediately after updating to the latest version. I have about 50 live bookmarks on my bookmarks bar and they all stopped working. They charge not even manually - they don't show all the titles: emp

  • change the administrator account

    How to change the name of the administrator accounts?

  • Satellite L750 - hard drive failure

    Above laptop gave message that wasn't hard drive. It is two years old.Should I replace hard drive or an entire computer.Computer has had a reasonable use.

  • from speech recognition in windows 7

    Cannot start speech recognition by using windows 7. headseat is not working properly, adjusted to my voice, msg pop "cannot start the speech recognition, language recognition configuration to match language windows user, change in advanced options."

  • Connection failed "launch system" distance DRAC5

    the details of the server are: Server: windows Server 2003, Enterprise edition (pe) 1950 RAC: DRAC 5, material A00, 1.33 firmware (did not see newer versions on the dell site) -I can connect and send the DRAC GUI (remote and on the server) -First, I