How to  Join two tables using the Inner Join

Hi All,
I have two tables i.e table1 and table2 as i have created two otds and my present requirement is to join this two tables and get the results and using this i need to do some logic and update another table3.
can some one help me out how to go for the above req.
Thanks in Advance
Srikanth

The best efficient way to use inner join is create two input otds,use there otd's in create a collaboration usinf etl.
after selecting two input otd's create a inner join statement and map it to out put otd.
while using the etl the performance of the over all integration is increased 20 time of the normal integration.
Hopes this will helps,,
Thanks,
Papa Rao.

Similar Messages

  • How do I join two tables in the same database and load the result into a destination table in a SSIS package

    Hi,
    I have a query that joins two tables in the same database, the result needs to be loaded in a destination DB table.  How do I do this in SSIS package?
    thank you !
    Thank You Warmest Fanny Pied

    Please take a look at these links related to your query.
    http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers
    http://stackoverflow.com/questions/7037228/joining-two-tables-together-in-one-database

  • Need help to join two tables using three joins, one of which is a (between) date range.

    I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
    the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
    ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
    [ABCTABLE]
    ABCORDER
    ABCPART
    ABCSERIAL
    ABCDATE
    [ZYXTABLE]
    XYZORDER
    XYZPART
    XYZSERIAL
    XYZDATE1
    XYZDATE2

    Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
    on this computer. There are no "Null" fields in either of the tables. 
    This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
    [MSORDR]
    MSORDER
    MSPART
    MSSERIAL
    MSOPNDATE
    11111111
    4444444
    55555
    2/4/2015
    22222222
    6666666
    11111
    1/6/2015
    33333333
    6666666
    11111
    3/5/2015
    This table has one order for every part number and every serial number.
    [GLORDR]
    GLORDER
    GLPART
    GLSERIAL
    GLSTARTDATE
    GLENDDATE
    ABC11111
    444444
    55555
    1/2/2015
    4/4/2015
    ABC22222
    666666
    11111
    1/5/2015
    4/10/2015
    AAA11111
    555555
    22222
    3/2/2015
    4/10/2015
    Post Query table
    GLORDER
    MSORDER
    GLSTARTDATE
    GLENDDATE
    MSOPNDATE
    ABC11111
    11111111
    1/2/2015
    4/4/2015
    2/4/2015
    ABC22222
    22222222
    1/5/2015
    4/10/2015
    1/6/2015
    ABC22222
    33333333
    1/5/2015
    4/10/2015
    3/5/2015
    This is the SQL minus the between date join.
    SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
    FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART);

  • LEFT OUTER JOIN multiple tables - using the 9i syntax

    I've always written my queries using the (+) operator for outer joins. I want to start using the new ANSI standard available in 9i. I can do it when I'm joining two tables in a simple query, but how does it work when I am joining multiple tables?
    Here is an example of some SQL that works with the (+) outer join syntax. How can I convert this to use the LEFT OUTER JOIN syntax?
    SELECT *
    FROM audit_entry aue,
    audit_table aut,
    audit_statement aus,
    audit_row aur,
    audit_row_pkey aup1,
    audit_row_pkey aup2
    WHERE aue.audit_entry_id = aus.audit_entry_id
    AND aut.table_name = 'TEST_AUDITING'
    AND aut.table_owner = 'CLA_JOURNAL'
    AND aus.audit_table_id = aut.audit_table_id
    AND aur.audit_statement_id (+) = aus.audit_statement_id
    AND aup1.audit_row_id (+) = aur.audit_row_id
    AND aup1.pk_column_name (+) = 'TEST_AUDTING_PK_1'
    AND aup2.audit_row_id (+) = aur.audit_row_id
    AND aup2.pk_column_name (+) = 'TEST_AUDITING_PK_2'
    I can join audit_statement to audit_entry easy enough, but then I want to join audit_table to audit_statement, how do I do that, do I start nesting the join statements?
    Thanks
    Richard

    Thanks for getting back so quickly, I have tried the suggested SQL with mixed results:
    SELECT COUNT(*)
    FROM audit_entry aue
    JOIN audit_statement aus ON aue.audit_entry_id = aus.audit_entry_id
    JOIN audit_table aut ON aus.audit_table_id = aut.audit_table_id
    RIGHT OUTER JOIN audit_row aur ON aur.audit_statement_id = aus.audit_statement_id
    RIGHT OUTER JOIN audit_row_pkey aup1 ON aup1.audit_row_id = aur.audit_row_id
    RIGHT OUTER JOIN audit_row_pkey aup2 ON aup2.audit_row_id = aur.audit_row_id
    WHERE aut.table_name = 'TEST_AUDITING_TWO'
    AND aut.table_owner = 'CLA_JOURNAL'
    AND aup1.pk_column_name = 'TEST_AUDTING_PK_1'
    AND aup2.pk_column_name = 'TEST_AUDITING_PK_2'
    I had to change the order slightly, between the first two JOINs but otherwise it executed OK. My problem is, it should only return 175 rows but its returning 30625 rows. If I comment out the second reference to audit_row_pkey I get the expected result:
    SELECT COUNT(*)
    FROM audit_entry aue
    JOIN audit_statement aus ON aue.audit_entry_id = aus.audit_entry_id
    JOIN audit_table aut ON aus.audit_table_id = aut.audit_table_id
    RIGHT OUTER JOIN audit_row aur ON aur.audit_statement_id = aus.audit_statement_id
    RIGHT OUTER JOIN audit_row_pkey aup1 ON aup1.audit_row_id = aur.audit_row_id
    --RIGHT OUTER JOIN audit_row_pkey aup2 ON aup2.audit_row_id = aur.audit_row_id
    WHERE aut.table_name = 'TEST_AUDITING_TWO'
    AND aut.table_owner = 'CLA_JOURNAL'
    AND aup1.pk_column_name = 'TEST_AUDTING_PK_1'
    --AND aup2.pk_column_name = 'TEST_AUDITING_PK_2'
    It looks the same condition is being used in each case but why do I suddenly get so many rows - its joining differently somehow. It must be to do with the order, do I need to bracket the query?
    Thanks again
    Richard

  • Join two table using two link field

    hi all
    i need to left join two table, and to link two table need to match two field
    ex: the link field is store_name and id
    i use below sql statement
    SELECT A1.store_name, A1.id, A1.card, A2.sale, A2.history
    FROM Georgraphy A1, Store_Information A2
    WHERE A1.store_name = A2.store_name(+)
    AND A1.id = A2.id(+)
    but it's wrong
    please tell me how to left join A1 and A2, thx!

    Whats your aim?
    Any error message?
    SQL> select * from geography;
            ID STORE_NAME
             1 a
             1 b
             2 a
             2 b
    SQL> select * from store_information;
            ID STORE_NAME
             1 a
             3 d
    SQL> SELECT *
      2  FROM Geography A1, Store_Information A2
      3  WHERE A1.store_name = A2.store_name(+)
      4  AND A1.id = A2.id(+);
            ID STORE_NAME         ID STORE_NAME
             1 a                   1 a
             2 a
             2 b
             1 b                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How we relate two tables using foreign key(fk)?

    hi to all,
        what are the conditions has to follow to relate two tables.I.e.,
    the two tables have same primary keys(pk). if we relate these two tables in one table the pk and fk will be the same then how that table in active.

    Hi
    To relate two tables..we have foreign key relationship.
    In one table v have primary key and in the second table, the same key is foreign key for that table..
    To relate two tables, we can use JOINS
    If there is already a suitable foreign key between two tables used in the view, these tables can be linked with a join condition from this foreign key.
    Create a view on tables TAB1 and TAB2. TAB1 is the primary table of the view. TAB2 is the secondary table of the view. TAB1 is the check table for TAB2. The foreign key fields are assigned to the check table fields as follows:
    TAB1-FIELD_A assigned to TAB2-FIELD_1
    TAB1-FIELD_A assigned to TAB2-FIELD_1
    The join condition of the view generated from the foreign key is then:
    CREATE VIEW ... AS SELECT ... WHERE TAB2-FIELD_1 = TAB1-FIELD_A AND TAB2-FIELD_2 = TAB1-FIELD_B.
    Join conditions can also be copied from generic and constant foreign keys. If a constant is assigned to a field in the foreign key, it is also assigned to the field in the join condition. There is no join condition for a generic relationship in the foreign key.
    The foreign key between tables TAB1 (check table) and TAB2 (foreign key table) is defined as follows:
    TAB1-FIELD_A assigned to TAB2-FIELD_1
    TAB1-FIELD_B generic
    TAB1-FIELD_C assigned to constant ‘C’
    The join condition for the view generated from the foreign key is in this case:
    CREATE VIEW ... AS SELECT ... WHERE TAB2-FIELD_1 = TAB1-FIELD_A AND TAB2-FIELD_2 = ‘C’.
    Hope it helps
    Reward if useful.

  • Join two tables using union

    Hi Gurus,
    I have three tables. I want to join all tables using union in SQL statement. The query is returning all the records from both tables but i only require unique rows based on a specific column value. Here is my table structure -
    TableA -
    LIC_ID          NUMBER(10)     NOT NULL
    LIC_NUMBER     VARCHAR2(20)
    COMMENCE_DATE     DATE
    EXPIRY_DATE     DATE
    TERM          VARCHAR2(20)LIC_ID is the primary key in this table -
    Sample data from TableA
    LIC_ID          LIC_NUMBER     COMMENCE_DATE          EXPIRY_DATE     TERM
    2          TR4323          12/04/2008          11/03/2010     2 Years
    34          TR5432          23/07/2009          22/07/2010     1 Year
    45          TR5321          24/06/2009          23/06/2010     1 Year
    65          TR6666          23/07/2010          22/07/2011     1 Year
    32          TR2423          30/05/2010          29/05/2011     1 YearTableB -
    MAR_ID          NUMBER(10)     NOT NULL
    LIC_ID          NUMBER(10)     NOT NULL
    ZONE_NAME     VARCHAR2(20)
    DEPARTMENT     VARCHAR2(20)
    ACTIVITIES     VARCHAR2(200)
    COMMENTS     VARCHAR2(200)MAR_ID is the primary key in this table and LIC_ID is the foreign key on TableA
    Sample data from TableB -
    MAR_ID          LIC_ID          ZONE_NAME     DEPARTMENT     ACTIVITIES     COMMENTS
    23          2          ZONE A          IT          NONE               
    43          34          ZONE B          IT          NONE
    33          65          ZONE C          ACCOUNT          NONE     
              TableC
    REC_ID          NUMBER(10)     NOT NULL
    LIC_ID          NUMBER(10)     NOT NULL
    DIST_NAME     VARCHAR2(20)
    REGION          VARCHAR2(20)
    ACTIVITIES     VARCHAR2(200)
    COMMENTS     VARCHAR2(200)REC_ID is the primary key in this table and LIC_ID is the foreign key.
    Sample data -
    REC_ID          LIC_ID          DIST_NAME     REGION          ACTIVITIES     COMMENTS
    2          45          SA          NORTH          NONE
    3          65          TA          NORTH          NONE
    5          32          NT          SOUTH          NONEHere is my sql query -
    select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
    TableA a, TableB b
    where a.lic_id=b.lic_id
    union
    select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
    TableA a, TableC c
    where a.lic_id=c.lic_idThe above query returns -
    lic_id          lic_number     commence_date          expiry_date          
    2          TR4323          12/04/2008          11/03/2010     
    34          TR5432          23/07/2009          22/07/2010     
    45          TR5321          24/06/2009          23/06/2010     
    65          TR6666          23/07/2010          22/07/2011     
    32          TR2423          30/05/2010          29/05/2011
    65          TR6666          23/07/2010          22/07/2011     LIC_ID 65 exists in both table TableB and TableC hence it repeats in query but I want to display that only once. How can I do that? I want to return unique record on LIC_NUMBER.
    Hope this make sence.
    Many thanks,
    Tajuddin

    Thanks for all your reply and suggestions. David altering session did not work.
    Sven your idea helped me to figure it out what to do. I found a way around to fix it. Here is my current code -
    select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
    TableA a, TableB b
    where a.lic_id=b.lic_id
    union
    select a.lic_id, a.lic_number, a.commence_date, a.expiry_date from
    TableA a, TableC c
    where a.lic_id=c.lic_id and c.lic_id not in ( select lic_id from TableB)This will exclude any LIC_ID exists in TableB.
    Thanks again for your help guys.
    Regards,
    M Tajuddin
    Web: http://tajuddin.whitepagesbd.com
    Blog: http://aspblog.whitepagesbd.com

  • Joining two tables using PL/SQL

    here i am trying to join two tables can any one tell me what is wrong with this syntex
    CREATE OR REPLACE PROCEDURE test IS
    CURSOR c1 IS SELECT seq,fname,lname from t1;
    CURSOR c2 IS SELECT seq1,q,a from t2;
    userjob number;
    BEGIN
         OPEN c1;
    insert into t3 values(c1.seq,c1.fname,c1.lname);
         FETCH c1.seq INTO userjob;
    FOR c1rec IN c2 LOOP
    IF (c1rec.seq=c1.seq and c1rec.q1='why') THEN
    insert into t3 values(c1rec.q1,c1rec.a1);
    elsif (c1rec.seq=c1.seq and c1rec.q1='what') then
    insert into t3 values(c1rec.q2,c1rec.a2);
    elsif (c1rec.seq=c1.seq and c1rec.q1='when') then
    insert into t3 values(c1rec.q3,c1rec.a3);
    elsif (c1rec.seq=c1.seq and c1rec.q1='where') then
    insert into t3 values(c1rec.q4,c1rec.a4);
         END IF;
         END LOOP;
         END;
    /

    You should always fetch a cursor before using it's values. All columns in the select should be fetched into variables or a record-variable. You can't refer to the cursor-columns values with c1.seq etc.
    r1 c1%rowtype;
    l_found boolean;
    BEGIN
    OPEN c1;
    FETCH c1 INTO r1;
    insert into t3 values(r1.seq,r1.fname,r1.lname);
    l_found := c1%found;
    close c1;
    if l_found
    then
    It is also better to close the cursor and check if the select resulted in a row. With this code you will only retrieve one row even if the select will result in multiple rows.
    But I agree with all the others that this can probably be done more efficiently with one SQL statement.

  • How to join two tables using EJB-QL

    Hi There,
    How to join tables using EJB-QL ?
    Thanks.
    Edited by: vamseebobby on Nov 6, 2007 8:12 AM

    You might try
    SELECT b.entity2property FROM Entity1 a JOIN a.entity2 b
    for example, to retrieve players names, from a Players table, that belong to the team 'My Team' in the Teams table
    SELECT b.playerName FROM Teams a JOIN a.players b WHERE a.teamName = 'My Team'

  • How do I join two letters using the shape builder tool?

    I am making a sign for my logo. The 'i' in my script face is long and overlaps the following letter which the sign maker's router will not read. So I would like to be able to use the shape builder tool to join the 3 instances where the letter 'i' appears each to the following letter. No luck so far. I have turned the type into points. I have highlighted the first instance, 'i' and 'c'. but the shape builder tool shows a circle with a line through it... not working.
    Anyone have an idea?

    It may take a combination of some of the Pathfinder tools, such as: Intersect, Merge, and Unite.  And, it may be a matter of manually going in and deleting some anchor points in the outlines.  Do some experimenting on copies of the instances.  Might be a process of elimination.

  • How to avoid duplicated rows using the outer join

    Hi everybody,
    I have the following query:
    select a.usr_login, b.ugp_rolename, b.ugp_display_name from
    (select usr.usr_login, usr.usr_key, usg.ugp_key from usr,usg
    where usg.usr_key = usr.usr_key
    and usr.usr_login IN ('C01015','C01208')) a,
    (select ugp.ugp_key, ugp.ugp_display_name from ugp
    where ugp.ugp_rolename LIKE 'B-%') b
    where a.ugp_key = b.ugp_key (+)
    The first query 'a' has the following result:
    usr_login <space> usr_key <space> ugp_key
    C01015 <space> 49 <space> 565
    C01015 <space> 49 <space> 683
    C01015 <space> 49 <space> 685
    C01015 <space> 49 <space> 3
    C01208 <space> 257 <space> 3
    The usr_login on table usr is the primary key, and as you can see above, for each usr_login I can find one ore more ugp_key on the table usg.
    The query 'b' gives the list of all the usr_login's roles which have the name LIKE 'B-%' (it means '*Business Roles*'), and all the respective role's key (ugp_key)
    So, when I join the query 'a' with the query 'b', I expect to find for every usr_login the respective ugp_display_name (the Business Role name).
    Because the query 'b' contains ONLY the ugp_keys of the Business Roles, when I execute the complete query, this is the result:
    usr_login <space> ugp_rolename <space> ugp_display_name
    C01015 <space> BK005 <space> TELLER 1
    C01015 <space> BK003 <space> TELLER 2
    C01015 <space> null <space> null
    C01015 <space> null <space> null
    C01208 <space> null <space> null
    As you can see, with the outer join I obtain the Business Name (ugp_display_name) for each occurrence (and I have 2 rows duplicated with 'null' for the usr_login C01015); This beacuse the query 'b' doesn't have the two ugp_keys 685 and 3.
    Instead I'd like to have the following result:
    usr_login <space> ugp_rolename <space> ugp_display_name
    C01015 <space> BK005 <space> TELLER 1
    C01015 <space> BK003 <space> TELLER 2
    C01208 <space> null <space> null
    deleting ONLY the duplicated rows with null, when the usr_login has already at least one ugp_display_name not null.
    For example:
    1) The usr_login 'C01015' has 2 Business Roles (with ugp_key = 565 and 683) and other 2 not-Business Roles (with ugp_key = 685 and 3) --> I want to see ONLY the 2 records related to the Business Roles
    2) The usr_login 'C01208' has only one not-Business Roles (with ugp_key = 3) --> I want to see the record related to the not- Business Role
    Practically:
    1) When a usr_login has one or more Business Roles and other not-Business Roles , I'd like to see ONLY the records about the Business Roles (not the records with 'null','null')
    2) When a usr_login doesn't have Business Roles, I'd like to see the records about the same usr_login with 'null','null'
    This, because I need to show both usr_logins: with and without Business Roles.
    Anybody has any suggestions ? Any help will be appreciated.
    Thanks in advance for any help !!
    Alex

    Hi, Alex,
    So you want to display rows from a where either
    (1) the row has a match in b, or
    (2) no iwith the same usr_login has a match.
    Here's one way to do that:
    WITH     a     AS
         SELECT  usr.usr_login, usr.usr_key, usg.ugp_key
         FROM      usr
         ,     usg
         WHERE      usg.usr_key     = usr.usr_key
         AND     usr.usr_login     IN ('C01015','C01208')
    ,     b     AS
         SELECT  ugp.ugp_key, ugp.ugp_display_name
         FROM      ugp
         WHERE     ugp.ugp_rolename     LIKE 'B-%'
    ,     got_match_cnt     AS
         SELECT     a.usr_login, b.ugp_rolename, b.ugp_display_name
         ,     b.ugp_key
         ,     COUNT (b.ugp_key) OVER (PARTITION BY  a.usr_login)     AS match_cnt
         FROM      a
         ,     b
         WHERE     a.ugp_key     = b.ugp_key (+)
    SELECT     usr_login, ugp_rolename, ugp_display_name
    FROM     got_match_cnt
    WHERE     ugp_key          IS NOT NULL     -- Condition (1)
    OR     match_cnt     = 0              -- Condition (2)
    ;If b.ugp_rolename or b.ugp_display_name can not be NULL, then you could use that just as well as b.ugp_key for testing condition (1).
    By the way, you don't need sub-queries for a and b; you can do all the joins and all the filtering (except conditions (1) and (2)) in one query, but the sub-queries aren't hurting anything. If you find the separate sub-queries easier to understand, debug and maintain, then, by all means, keep them.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.

  • Issues while joining two tables as the joining column has duplicate values - Please help!

    Hi,
    I have a table A -which has few columns including a Amount column - I am joining this table A to Table B. The joining column in B has duplicates.  So, the number of records are getting more after the joining. As per the requirment when I create a table
    after joining the tables and count the salary clumn, there is a difference in the counting. How can I solve this? Can you please help me?
    Here is the DDL and sample values
    create table #student (sid int, name varchar(10),salary int)
    create table [#address] (sid int, city varchar(10),grade char(1),lineneumber int)
    insert into #student values (1,'sachin',8000)
    insert into #student values (2,'Dhoni',2000)
    insert into #student values (3,'Ganguly',7000)
    insert into #student values (4,'Kohli',1000)
    insert into [#address] values(1,'mumbai','A',1)
    insert into [#address] values(1,'mumbai','B',2)
    insert into [#address] values(1,'mumbai','C',3)
    insert into [#address] values(1,'mumbai','D',4)
    insert into [#address] values(2,'JARKHAND','D',3)
    insert into [#address] values(2,'JARKHAND','D',4)
    SELECT S.SID,NAME,salary,CITY ,grade,linenumber
    into #FINAL
    FROM #STUDENT S
    LEFT JOIN #ADDRESS A
    ON S.SID=A.SID
    SELECT SUM(salary) FROM #FINAL
    --44000
    Final result should be 18000 , but it is coming as 44000. can you please help me to get the correct result - what do i do in the joining?
    In my real project, i have 5 tables joining, each table have more than 30 columns and few joining tables joining column have duplicates. I have simplified the issue so that i can ask the question clearly. So,while answering, please consider that also in mind.
    thanks in advance for your help!

    SELECT S.SID,NAME,salary,CITY 
    into #FINAL
    FROM #STUDENT S
    LEFT JOIN (SELECT DISTINCT sid,city
    FROM #Address) A
    ON S.SID=A.SIDthis will do a join on student table and city table with unique sid and city name so adddress selection will be sid city1 mumbai2 jarkand

  • How to join two tables using UD Connect ?

    Hi,
    I have 2 tables on which I need to create join & extract the data from Oracle database using UD connect. Is this possible? If yes, please let me know how or suggest an alternative approach.
    Thanks,
    Sunil

    Thanks Tony for the reply..  Actually, the issue is Netweaver Java dictionary doesn't allow you to create a view, right? Also, I dont want to create a view directly on the database.
    I want to handle this on BI side somehow.

  • How to update two tables at the same time using jdbc

    Plz will anybody tell me what is the code or query in jdbc by which you insert entry in one table and simultaneously it goes in another table?
    Thanks in advance

    You might be
    able to design a trigger to do what you're talking
    about, but that would be a database thing, not a java
    thingAnother option would be an updatable view (google for usage), but it has limitations and should be used with caution. And yes, its a database thinggy and not java.
    cheers,
    ram.

  • Join two tables with the same information

    I have a registration database. It references two other tables. I accept registrations from Faculty and from Students, but their information is in two different tables. Both have fname and lname. If they have people_id filled in, I want the fname and lname from the People table. If they have student_id filled in, I want it from the Student table.
    I've never done this sort of IF situation. Here are the tables:
    create table passport_registration (
         passport_registration_id NUMBER Primary Key,
         date_added date,
         student_id NUMBER REFERENCES students(student_id),
         people_id NUMBER REFERENCES people(id),
         passport_listing_id NUMBER REFERENCES passport_listing(passport_listing_id)
    create table PEOPLE (
    id NUMBER Primary Key,
    dateModified date,
    fname VARCHAR2(100),
    lname VARCHAR2(100)
    create table students (
         student_id NUMBER Primary Key,
         date_added date,
         s_uid VARCHAR2(50),
         fname VARCHAR2(50),
         lname VARCHAR2(50)
    Any sort of assistance is appreciated.
    Thank you.
    daniel

    (It'd be helpful if you could edit your post and stick {noformat} before and after your sql statement - that will format it so that the (+){noformat} show correctly instead of being converted to the (+) symbol!)
    As to the questions:
    1. You've got two columns that have a decision to be made on them; you're going to need to write two sets of decision-making code, one for each column. I guess you could also do something like:select a.col1, d.col2, d.col3
    from table1 a, (select 'table2' cola, b.col1, b.col2, b.col3 from table2 b
    union all
    select 'table3' cola, c.col1, c.col2, c.col3 from table3 c) d
    where a.col1 = d.col1
    and nvl2(a.col2, 'table3', 'table2') = d.cola;
    nb, not tested, and I'm up far too late, so could have made an easy mistake!
    2. Yes, {noformat} (+){noformat} is the oracle method of doing outer joins; it could be rewritten into ansi joins if you like; I'm just not that familiar with them to do it myself!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • Highlighting text in preview without "touchpad click"

    I am working a lot on pdfs in which I have to highlight certain parts. I use Mac's Preview. So far I have been using the touchpad, by e.g. clicking and then dragging the cursor over the relevant section. This might sound a bit silly, but the clicking

  • Getting Pixel values from a RenderedOP

    Hi, I'm trying to run thru the pixels of finalmage : RenderedOp finalImage = JAI.create("subtract",pbSubtracted); and add the the pixels x and y to an array if the colour of the pixel isnt black, what shud i be using, i tried setting it up as a buffe

  • Share dvd with windows vista

    hi, I have the new mac mini and would like to share the dvd with a windows vista pc, after all the installation and the configuraztion of both apple and pc on a local network, I can see the windows pc but it doesn't share the dvd! someone can help pl

  • Transport a web template

    Does anybody know if it is possible to transport a web template for example from a test system into a production system? Or do I have to do it manually? With "export to file"? Thanks in advance

  • I can't open Aperture 1.5.6 after updating to 10.6.8/Snow Leopard

    I can't open Aperture 1.5.6 after updating to my mac10.6.8/Snow Leopard. What should I do. I don't want to lose all my pictures.