Update with INNER JOIN

Hello

My update with the inner join does not seem to work.

UPDATE RECAP R SET R.FLAVOR = (SELECT FN. FLAVOR_NDC FN FLAVOR, REPLACE CAP R WHERE R.NDC11 = FN. NDC11)

When I write the query above, the inner circle question (SELECT FN. FLAVOR_NDC FN FLAVOR, REPLACE CAP R WHERE R.NDC11 = FN. NDC11) returns multiple lines, and it's a new syntax for me (as I was Teradata and SQL server).

Can you please how this request can be written to make it work?

I get the error message below

SQL error: ORA-01427: einreihig subquery returns multiple rows
01427 00000 - "einreihig subquery returns several lines.

1. fix your code:

UPDATE RECAP R SET R.FLAVOR = (SELECT FN.FLAVOR FROM FLAVOR_NDC FN WHERE R.NDC11 = FN.NDC11)

2. you can use the fusion

merge into RECAP R
using FLAVOR_NDC FN
on(R.NDC11 = FN.NDC11)
when matched then
     update
     set R.FLAVOR = FN.FLAVOR

Kind regards
Malakshinov Sayan

Tags: Database

Similar Questions

  • Update with the join and group by

    Hi all

    I'm currently updating multiple columns in a table from an inner join query.
    First one recover the affected rows and values that I need for the update (which I call this subquery ED_Query).
    It is important to note that this subquery has a group of and and the having clause.

    My first attempt (using the query running in the SQL Server query) fails:

    SQL > update ED_Update
    2 set ED_Update.dtHoraInicioReal = ED_Query.dtHoraInicioReal,
    3 ED_Update.dtHoraFinReal = ED_Query.dtHoraFinReal,
    4 ED_Update.fPorcentajeRealizado = ED_Query.fPorcentajeRealizado
    HISTORICOS_AVANZA 5. HSAE_HIS_EXPEDICIONDIARIA ED_Update
    inner join 6)
    7. select distinct ED.iIdExpedicion, ED.iIdExpedicionDiaria,
    8 MAX (PT.iOrdenEnTrayecto) + 1 as iNumParadas,
    9 MAX (HPP.iOrden) as iOrdenUltimaParada,
    10 MIN (dtHora_LlegadaReal + iTiempoEnParada /(24*60*60)) as dtHoraInicioReal,
    11 MAX (dtHora_LlegadaReal) as dtHoraFinReal,
    12 100 * cast ((MAX (HPP.iOrden) + 1) as float) / cast ((MAX (PT.iOrdenEnTrayecto) + 1) as float) as fPorcentajeRealizado
    13 of HISTORICOS_AVANZA. ED HSAE_HIS_EXPEDICIONDIARIA
    14 left join HISTORICOS_AVANZA. HSAE_HIS_HORAPASOPARADA HPP
    15 ED.iIdExpedicion = HPP.iIdExpedicion and ED.dtJornada = HPP.dtJornada
    16 left join AVANZA. SAE_URB_PARADASTRAYECTO PT on ED.iIdLinea = PT.iIdLinea and ED.iIdTrayecto = PT.iIdTrayecto
    17 where ED.dtJornada = TO_DATE (January 14, 2013 ',' DD/MM/YYYY ') and ED.iIdExpedicion in (-131076)
    18 ED.iIdExpedicion, ED.iIdExpedicionDiaria, ED.dtHoraInicioReal, ED.dtHoraFinReal group
    19 having ED.dtHoraInicioReal <>min (dtHora_LlegadaReal + iTiempoEnParada /(24*60*60))
    20 or ED.dtHoraFinReal <>max (dtHora_LlegadaReal)
    (21) ED_Query
    22 we ED_Update.iIdExpedicionDiaria = ED_Query.iIdExpedicionDiaria;

    ERROR on line 5:
    ORA-00933: SQL not correctly completed command.

    Subquery (ED_Query) work fine in Oracle, so I suspect that the problems are when I mix with the update clause.

    SQL > select distinct ED.iIdExpedicion, ED.iIdExpedicionDiaria,.
    2 MAX (PT.iOrdenEnTrayecto) + 1 as iNumParadas,
    3 MAX (HPP.iOrden) as iOrdenUltimaParada,
    4 MIN (dtHora_LlegadaReal + iTiempoEnParada /(24*60*60)) as dtHoraInicioReal,
    5 MAX (dtHora_LlegadaReal) as dtHoraFinReal,
    6 100 * cast ((MAX (HPP.iOrden) + 1) as float) / cast ((MAX (PT.iOrdenEnTrayecto) + 1) as float) as fPorcentajeRealizado,
    7 ED.dtHoraInicioReal ED_dtHoraInicioReal, ED.dtHoraFinReal as ED_dtHoraFinReal, ED.fPorcentajeRealizado as ED_fPorcentajeRealizado
    8 of HISTORICOS_AVANZA. ED HSAE_HIS_EXPEDICIONDIARIA
    9 left join HISTORICOS_AVANZA. HSAE_HIS_HORAPASOPARADA HPP
    10 on ED.iIdExpedicion = HPP.iIdExpedicion and ED.dtJornada = HPP.dtJornada
    11 left join AVANZA. SAE_URB_PARADASTRAYECTO PT on ED.iIdLinea = PT.iIdLinea and ED.iIdTrayecto = PT.iIdTrayecto
    where the ED.dtJornada 12 = TO_DATE (January 14, 2013 ',' DD/MM/YYYY ') and ED.iIdExpedicion in (-131076)
    13 group of ED.iIdExpedicion, ED.iIdExpedicionDiaria, ED.dtHoraInicioReal, ED.dtHoraFinReal, ED.fPorcentajeRealizado
    14 after ED.dtHoraInicioReal <>min (dtHora_LlegadaReal + iTiempoEnParada /(24*60*60))
    15 or ED.dtHoraFinReal <>max (dtHora_LlegadaReal);

    IIDEXPEDICION IIDEXPEDICIONDIARIA INUMPARADAS IORDENULTIMAPARADA DTHORAINI
    ------------- ------------------- ----------- ------------------ ---------
    DTHORAFIN FPORCENTAJEREALIZADO ED_DTHORA ED_DTHORA ED_FPORCENTAJEREALIZADO
    --------- -------------------- --------- --------- -----------------------
    -131076 5662 406 15 JANUARY 13
    15 JANUARY 13 JANUARY 15, 13 15 JANUARY 13 0

    -131076 5663 406 15 JANUARY 13
    15 JANUARY 13 JANUARY 15, 13 15 JANUARY 13 0

    -131076 5664 406 15 JANUARY 13
    15 JANUARY 13 JANUARY 15, 13 15 JANUARY 13 0

    After reading this forum, I have change the query and try the following:

    SQL > UPDATE
    () 2
    3. select distinct ED.iIdExpedicion, ED.iIdExpedicionDiaria,
    4 MAX (PT.iOrdenEnTrayecto) + 1 as iNumParadas,
    5 MAX (HPP.iOrden) as iOrdenUltimaParada,
    6 MIN (dtHora_LlegadaReal + iTiempoEnParada /(24*60*60)) as dtHoraInicioReal,
    7 MAX (dtHora_LlegadaReal) as dtHoraFinReal,
    8 100 * cast ((MAX (HPP.iOrden) + 1) as float) / cast ((MAX (PT.iOrdenEnTrayecto) + 1) as float) as fPorcentajeRealizado,
    9 ED.dtHoraInicioReal ED_dtHoraInicioReal, ED.dtHoraFinReal as ED_dtHoraFinReal, ED.fPorcentajeRealizado as ED_fPorcentajeRealizado
    HISTORICOS_AVANZA 10. ED HSAE_HIS_EXPEDICIONDIARIA
    11 left join HISTORICOS_AVANZA. HSAE_HIS_HORAPASOPARADA HPP
    12 on ED.iIdExpedicion = HPP.iIdExpedicion and ED.dtJornada = HPP.dtJornada
    13 left join AVANZA. SAE_URB_PARADASTRAYECTO PT on ED.iIdLinea = PT.iIdLinea and ED.iIdTrayecto = PT.iIdTrayecto
    14 where ED.dtJornada = TO_DATE (January 14, 2013 ',' DD/MM/YYYY ') and ED.iIdExpedicion in (-131076)
    Group 15 of ED.iIdExpedicion, ED.iIdExpedicionDiaria, ED.dtHoraInicioReal, ED.dtHoraFinReal, ED.fPorcentajeRealizado
    16 having ED.dtHoraInicioReal <>min (dtHora_LlegadaReal + iTiempoEnParada /(24*60*60))
    17 or ED.dtHoraFinReal <>max (dtHora_LlegadaReal)
    18)
    19 SET ED_dtHoraInicioReal = dtHoraInicioReal,
    20 ED_dtHoraFinReal = dtHoraFinReal,
    21 ED_fPorcentajeRealizado = fPorcentajeRealizado;

    ERROR on line 2:
    ORA-01732: operation non-legal data manipulation on this point of view

    Little help?

    Thanl in advance.

    Published by: 984483 on 28-ene-2013 01:48

    Hello

    Thanks for posting the CREATE TABLE and INSERT.
    Don't forget to post the desired results of these sample data, i.e. the content of the or the tables changed after the UPDATE is made.

    Is that what you want ed_update to look like after that everyhting is finished?

    DATE01      NUMBERMAX  NUMBERSUM
    ---------- ---------- ----------
    01/01/2013         30         60
    02/01/2013          0          0
    03/01/2013          0          0
    

    If so, here's a way to do it:

    UPDATE     ed_update     u
    SET     (numbermax, numbersum) =
         (
                 SELECT  MAX (number01)
              ,     SUM (number01)
              FROM     ed_query
              WHERE     date01     = u.date01
         )
    WHERE     date01     = TO_DATE ('01/01/2013', 'DD/MM/YYYY')   -- If wanted
    ;
    

    In Oracle, INNER JOIN works only in the FROM clause of a SELECT statement.
    When you want to update a table with values from another table, you can do a subquery correlated (as I showed above) or use the MERGER instead of UPDATE.

  • Help with Inner join problem

    The following query works fine as long as there is a value in the subID field, which is the end of the inner join statement. If the subID is empty then no data is output, even if it is there. Try as I may, I can't do the right solution in which the statement to get the data to show without the subID. What Miss me?

    < name cfquery = "getInfo" datasource = "#application.database #" >

    Select page_id, pageName, pages.content, pages.cat_id, pages.seo_title, pages.seo_desc, pages.seo_words, pages.h1_title, pages.pic, pages.brochure, pa ges.video, catagories.catagory, subcat.subID, subcat.sub_category

    (page INNER JOIN categories ON pages.cat_id = catagories.cat_id) INNER JOIN subcat ON pages.subID = subcat.subID

    where pages.page_id = #page_id #.

    < / cfquery >

    Rick,

    Looks like you need a LEFT OUTER join to the table "subcat", so that all the records for the 'pages' and 'categories' are returned, even if no records matching "subcat" doesn't exist.  Joins INTERNAL returns only the selected records when both sides of the join statement tables have matching values, while you will get a join OUTER LEFT (sometimes also known simply as a LEFT JOIN) * everything * selected records from the table on the left side of the join statement, no matter if he adapt records from the table on the right side of the join statement.  When there is no corresponding record in the table on the right side of the join statement, all the columns in your SELECT clause that come from the table on the right side of the join statement will contain NULL values.

    HTH,

    -Carl V.

  • error in the update with a join query

    Hi all

    IM using oracle 10g on windows.

    im not able to use this update query with join...

    UPDATE
    b
    SET
    b.is_stud = 1
    Of
    b Boy
    JOIN IN-HOUSE
    the relationship r
    WE
    b.ID = r.boy_id;

    Thank you very much...
    MERGE into emp trg
    using(Select distinct b.ename ename,a.empno empno from emp a,
                 emp_status b where  a.empno=b.empno) src
    on
    (trg.empno=src.empno)
    when matched then
    update
    SET trg.name = src.ename;
    
  • Update with Outer Join, round 2

    Thanks for those of you who have helped me out on the first (I never thought that you could use a SELECTION of a line like that).

    However, here is a new version of my problem:

    I have three tables.
    Table_1 has a column that must be updated based on the Table_2 and Table_3 values.
    Table_1 both Table_2 have values used to determine which line of Table_3 to use.
    However, not all the rows in Table_1 has a corresponding line of Table_3, in which case the value of Table_3 to use is assumed to be 1.

    The tables and the corresponding columns are:

    TABLE_1
    value_1 - value update
    key_2 - a pointer to TABLE_2
    key_3a - a pointer to a TABLE_3 or a dummy value if there is no record of the TABLE_3

    TABLE_2
    key_2 - the primary key
    key_3b - a secondary pointer to TABLE_3
    Value_2 - a value to use in the calculation of TABLE_1.value_1

    TABLE_3
    key_3a - the first part of the unique key
    ley_3b - the second part of the unique key
    value_3 - a value to use in the calculation of TABLE_1.value_1

    If there is a line in table_3 which matches the values table_1.key_3a and table_2.key_3b (where table_2.key_2 = table_1.key_2):
    Set table_1.value_1 = table_2.value_2 * table_3.value_3
    If there is no such line in table_3:
    Set table_1.value_1 = table_2.value_2

    I want to do something like this:

    UPDATE table_1 t1
    SET = Value_1
    (
    SELECT T2.value_2 * NVL (t3.value_3, 1)
    IN table_2 t2
    LEFT JOIN t3 table_3
    WE (t3.key_3b = t2.key_3b and t3.key_3a = t1.key_3a)
    WHERE t2.key_2 = t1.key_2
    )

    However, Oracle does not t1 to be referenced in the outer join clause.
    (Assume that each value of key_2 in table_1 is table_2 as well: it is only the key_3 value that can be a model.)

    If I move "t3.key_3 = t1.key_3" to the WHERE clause, so t1.value_1 is null for lines without the corresponding value of the table_3.

    I can do it with a clone of table_1 using ROWID:

    UPDATE table_1 t1
    SET = Value_1
    (
    SELECT T2.value_2 * NVL (t3.value_3, 1)
    FROM table_1 t1a
    JOIN the t2 table_2
    ON t2.key_2 = t1a.key_2
    LEFT JOIN t3 table_3
    WE (t3.key_3b = t2.key_3b and t3.key_3a = t1a.key_3a)
    WHERE t1a.row_id = t1.row_id
    )

    However, is there an easier way to do it using ANSI joins (i.e. without (+) syntax)?
    I have this feeling I'm missing something obvious here.

    Sorry, I'm not sure understand your scenario this time. It is early and I did have my 64 ounces of caffiene still.

    I didn't look at the statement, you were trying to run and reformatting:

    SQL> UPDATE table_1 t1
      2  SET    value_1 = (SELECT t2.value_2 * NVL((select t3.value_3
      3                                             from   table_3 t3
      4                                             where  t3.key_3b = t2.key_3b
      5                                             and    t3.key_3a = t1.key_3a)
      6                                          ,1)
      7                    FROM   table_2 t2
      8                    WHERE  t2.key_2 = t1.key_2
      9                   )
     10  ;
    
    0 rows updated.
    

    I don't know if it will work for you, but at least it is syntactically correct.

  • Update with Outer Join

    Is it possible to do an update that involves an outer join on the updated table?

    Here's what I mean - now, I have something like:

    UPDATE table_1 t1
    SET col_1 =
    (
    SELECT t2.col_2
    IN table_2 t2
    WHERE t2.t1_key = t1.t1_key
    )
    WHERE THERE ARE
    (
    SELECT t2.*
    IN table_2 t2
    WHERE t2.t1_key = t1.t1_key
    );
    --
    UPDATE table_1 t1
    SET col_1 = 0
    WHERE THERE IS NO
    (
    SELECT t2.*
    IN table_2 t2
    WHERE t2.t1_key = t1.t1_key
    );

    Yes, I could set all values of table_1.col_1 = 0 first and then perform the update first, but it is inefficient because of the number of records in the table that could be updated twice.

    Is it possible to combine these two updates in a single update statement?

    You can simply use your first update and omit the WHERE EXISTS clause since you want to update all rows in table_1 anyway.

    If the subquery finds a match, it will update the selected value. Normally, a non-match would set the column to a null value, but you can solve this with NVL:

    SQL> select * from table_1;
    
                  T1_KEY                COL_1
    -------------------- --------------------
                       1                    1
                       2                    1
                       3                    1
                       4                    1
                       5                    1
                       6                    1
                       7                    1
                       8                    1
                       9                    1
    
    9 rows selected.
    
    SQL> select * from table_2;
    
                  T2_KEY                COL_2
    -------------------- --------------------
                       1                    9
                       3                    9
                       5                    9
    
    SQL> UPDATE table_1 t1
      2  SET    col_1 = nvl (
      3                       (SELECT t2.col_2
      4                        FROM   table_2 t2
      5                        WHERE  t2.t2_key = t1.t1_key
      6                       ),0
      7                     )
      8  ;
    
    9 rows updated.
    
    SQL> select * from table_1;
    
                  T1_KEY                COL_1
    -------------------- --------------------
                       1                    9
                       2                    0
                       3                    9
                       4                    0
                       5                    9
                       6                    0
                       7                    0
                       8                    0
                       9                    0
    
    9 rows selected.
    
  • Need help with the update with several joins statement

    I have the following select statement, which takes 29 records:
    SELECT
    PAA. PROJECT,
    PAA. SEGMENT1,
    PEIA.expenditure_item_id,
    PEIA.expenditure_type,
    PEC.expenditure_comment
    OF PA.PA_PROJECTS_ALL APP.
    PEIA PA.pa_expenditure_items_all,
    PEC PA.pa_expenditure_comments
    where PPA.segment1 < '2008' and
    PPA.project_id = 52 and - just run for project # 20077119 for the test
    PEIA.expenditure_type = 'PAY' and
    PEIA.project_id = ppa.project_id and
    PEC. EXPENDITURE_ITEM_ID = PEIA. EXPENDITURE_ITEM_ID;

    I need to update the pec.expenditure_comments to a static field for 29 records. I guess I should start with the following, but don't know how to fill in the where:
    Update
    PEC PA.pa_expenditure_comments
    Set pec.expenditure_comment = ' REFERENCE HD #728'.
    where
    ???

    First time we have ever needed to update, so any help appreciated.

    Try using are:

    update pa.pa_expenditure_comments pec
    set    pec.expenditure_comment = 'REFERENCE HD#728'
    where exists ( select null
                   from   pa.pa_projects_all ppa
                   ,      pa.pa_expenditure_items_all peia
                   ,      pa.pa_expenditure_comments pec2
                   where  ppa.segment1 < ''    -- not sure what you posted here, so for next time:
                                               -- please put your examples between the code tags.
                   and    ppa.project_id = 52  -- just run for project # 20077119 for testing
                   and    peia.expenditure_type = 'PAYROLL'
                   and    peia.project_id = ppa.project_id
                   and    pec2.expenditure_item_id = peia.expenditure_item_id
                   and    pec2.expenditure_item_id = pec.expenditure_item_id
                 );
    
  • Oracle: Inner join syntax

    Hello
    I am confused with Inner Join syntax.
    According to the defination of Inner Join, it is said that
    Inner joins return all rows in multiple tables satisfied the join condition.

    By the way by examples of inner join in web, join Inner is written in these syntaxes as indicated:

    First syntax:

    SELECT Person.LastName, Person.FirstName, person Sales.OrderNo INNER JOIN sales on Person.P_Id = Sales.P_Id

    Second syntax:

    SELECT suppliers.supplier_id, suppliers.supplier_name, orders.order_date
    FROM the suppliers orders
    WHERE suppliers.supplier_id = orders.supplier_id;

    Please tell me if the keyword Inner Join its use is mandatory or not?

    Thank you for reading.

    user672373773 wrote:
    First of all, thanks Anurag to your prompt response.

    I have a request here, please tell me why oracle has provided two syntax? This is the ANSI and non-ANSI syntax

    I know, it's the Oracle had a format no ANSI to join since its initial versions. In later versions, oracle decided to except ANSI format too since Oracle want to support the ansi format in almost everything.

    So since he was using the ansi non format, it can't support/stop using only for backward compatibility and also it as having the users to use the ansi format, it is both.

    Concerning
    Anurag

  • Syntax of UPDATE of Oracle with the JOIN and the WHERE clause

    I need to update one of my paintings and can't seem to get the syntax right. I tried 4 different approaches, but does not have a chance.  Any help would be greatly appreciated.

    Attempt #1: Error: not correctly completed SQL command

    UPDATE TESTDTA.F4941
    SET TESTDTA.F4941.RSDSTN=TESTDTA.F4981.FHRTDQ,TESTDTA.F4941.RSUMD1=TESTDTA.F4981.FHUOM
    FROM TESTDTA.F4941
    INNER JOIN TESTDTA.F4981
    ON TESTDTA.F4941.RSSHPN  = TESTDTA.F4981.FHSHPN
    WHERE TESTDTA.F4941.RSSHPN = 647143
    AND TESTDTA.F4941.RSDSTN = 0
    AND TESTDTA.F4941.RSADDJ  > 110365
    AND TESTDTA.F4981.FHCGC1  = 'DIS';

    Try #2: Error report: SQL error: ORA-00904: "TESTDTA." "" F4981 ". "' FHUOM ': invalid identifier 00904. 00000 - '% s: invalid identifier '.

    UPDATE (SELECT TESTDTA.F4941
    FROM TESTDTA.F4941
    INNER JOIN TESTDTA.F4981
    ON TESTDTA.F4941.RSSHPN  = TESTDTA.F4981.FHSHPN
    WHERE TESTDTA.F4941.RSSHPN = 647143
    AND TESTDTA.F4941.RSDSTN = 0
    AND TESTDTA.F4941.RSADDJ  > 110365
    AND TESTDTA.F4981.FHCGC1  = 'DIS')
    SET TESTDTA.F4941.RSDSTN=TESTDTA.F4981.FHRTDQ,TESTDTA.F4941.RSUMD1=TESTDTA.F4981.FHUOM


    Try #3: Error report: SQL error: ORA-00904: "TESTDTA." "' F4941 ': invalid identifier 00904. 00000 - '% s: invalid identifier '.

    UPDATE (SELECT *
    FROM TESTDTA.F4941
    INNER JOIN TESTDTA.F4981
    ON TESTDTA.F4941.RSSHPN  = TESTDTA.F4981.FHSHPN
    WHERE TESTDTA.F4941.RSSHPN = 647143
    AND TESTDTA.F4941.RSDSTN = 0
    AND TESTDTA.F4941.RSADDJ  > 110365
    AND TESTDTA.F4981.FHCGC1  = 'DIS')
    SET TESTDTA.F4941.RSDSTN=TESTDTA.F4981.FHRTDQ,TESTDTA.F4941.RSUMD1=TESTDTA.F4981.FHUOM;


    Try #4: Error: ORA-00925: Missing keyword 00925. 00000 - "missing IN the keyword"

    MERGE TESTDTA.F4941
    USING TESTDTA.F4981
    ON (TESTDTA.F4941.RSSHPN  = TESTDTA.F4981.FHSHPN
    AND TESTDTA.F4941.RSSHPN = 647143
    AND TESTDTA.F4941.RSDSTN = 0
    AND TESTDTA.F4941.RSADDJ  > 110365
    AND TESTDTA.F4981.FHCGC1  = 'DIS'
     
    )
    WHEN MATCHED THEN
    UPDATE SET TESTDTA.F4941.RSDSTN=TESTDTA.F4981.FHRTDQ
      
    ,TESTDTA.F4941.RSUMD1=TESTDTA.F4981.FHUOM;

    Finally managed to do work, adding DISTINCT to select.  I have pasted the SQL error in Google to begin with.  Laughing out loud!

    Code snippet work for anyone who comes across this thread...

    MERGE INTO TESTDTA. F4941 DST

    USING (SELECT DISTINCT TESTDTA. F4941. RSSHPN,

    TESTDTA. F4941. RSDSTN,

    TESTDTA. F4941. RSUMD1,

    TESTDTA. F4941. RSADDJ,

    TESTDTA. F4981. FHSHPN,

    TESTDTA. F4981. FHRTDQ,

    TESTDTA. F4981. FHUOM,

    TESTDTA. F4981. FHCGC1

    OF TESTDTA. F4941

    JOIN INTERNAL TESTDTA. F4981

    ON TESTDTA. F4941. RSSHPN = TESTDTA. F4981. FHSHPN

    WHERE - TESTDTA. F4941. RSSHPN = 647143 AND

    TESTDTA. F4941. RSDSTN = 0

    AND TESTDTA. F4941. RSADDJ > 110365

    AND TESTDTA. F4981. FHCGC1 = 'SAY') CBC

    on (DST. RSSHPN = SRC. FHSHPN)

    When matched then update

    SET DST. RSDSTN = SRC. FHRTDQ, SUMMER TIME. RSUMD1 = SRC. FHUOM;

    Thanks to everyone who helped with this.

  • SQL - update with joins

    My database contains several tables in a parent-child relationship (5 levels). Tables for children contain unique (foreign key) of the parents. I need to update a field in the table below level with a hardcoded value (for example: the value d.field3 = 103), but only on the rows that match certain general criteria. Criteria are set at different levels of the hierarchy. I tried several approaches, but in the end, I still get the same error:

    ORA-01779: cannot modify a column that is mapped to a table not preserved key

    So far, I tried the following:
    -create a view based on all joins (where b.fk = a.id etc.) and then write my update with the "filtering" query where clauses (for example: where b.field1 = 'abc' and c.field2 = 123... etc)
    -create a query of update (without creating a preliminary view) which contains in the 'where' clause all joins and clauses of filtering

    I am trying to adapt some scripts from SQL Server to Oracle, but nothing seems to work for this one. Your help is greatly appreciated.

    Thank you
    Alberto

    Something like:

    update CM_CRITERION_LINE_MASTER set function_id = 103
    where criterion_master_id in (
      SELECT CM_CRITERION_MASTER.criterion_master_id
      from CM_CRITERION_MASTER, CM_STATEMENT, CM_CRITERION, CM_RULE, CM_CASE
      where CM_CRITERION_MASTER.criterion_master_id = CM_CRITERION.criterion_master_id
        and CM_CRITERION.statement_id = CM_STATEMENT.statement_id
        and CM_STATEMENT.rule_id = CM_RULE.rule_id
        and CM_RULE.case_id=CM_CASE.case_id
        and CM_CASE.case_category_id=2
        and CM_CASE.case_id > 799999
        and CM_RULE.rule_category_id 9
        and CM_RULE.task_id in (102,108,112,113,114,123,116)
    )
      and CM_CRITERION_LINE_MASTER.function_id=11
    

    Of course, you need to test.

    Time to understand that SQL Server and Oracle, as well as other DBMS each differ :)

    Gints Plivna
    http://www.gplivna.EU

  • generator 10 I have a query with an inner join... join error unsupported expression! In a query, Report Designer cannot do a join?

    Hey in the 10 Report Builder Query Builder, I got an error:

    OftblFacility INNER JOIN tblStateProvince ON tblFacility.OIDStateProvince = tblStateProvince

    What is java.swl.SQLException: [Macromedia] [SequeLinkJDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] Join expression not taken in charge.

    Why?

    Report Designer will automatically join tables only if you have defined a relationship between them in your database.

    In Report Designer, you can easily create a join by dragging a field from one table to the related field in the other table. It couldn't be simpler.

    See you soon

    Eddie

  • problem with a query, inner join

    Hello;

    I am trying innerjoin these 2 tables in my request for a page that will allow you to add / modify records. Right now, it tells me that I have a lag of data. I do not see where I was wrong. Can someone help me?


    This is my code:

    < name cfparam = "url. CategoryID"type ="integer"default ="0">
    < name cfparam = 'subID' type = 'integer' default = '#url. CategoryID #">"
    < name cfparam = "subName" default = "" >
    < name cfparam = "CategoryID" default = "" >
    < name cfparam = "Name" default = "" >

    < cfif url. CategoryID GT 0 >
    < name cfquery = "categRec" dataSource = "#APPLICATION.dataSource #" >
    SELECT merchSubCat.subName, merchSubCat.subID, categories. CategoryID, Categories.Name
    OF merchSubCat
    JOIN INTERNAL categories
    ON merchSubCat.CategoryID = categories. CategoryID
    WHERE merchSubCat.subID = < cfqueryparam value = '#url. "CategoryID #" cfsqltype = "cf_sql_integer" >
    < / cfquery >

    <!-if the records were found, store the values->
    < cfif categRec.RecordCount EQ 1 >
    < cfset CategoryID = categRec.subID >
    < cfset subName = categRec.subName >
    < cfset CategoryID = categRec.CategoryID >
    < cfset Name = categRec.Name >
    < / cfif >
    < / cfif >

    It's my mistake:

    Run database query error.

    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver] Type in an expression mismatch.
    The error occurred in C:\Websites\187914kg3\admin\cms\merchant\merchSub-edit.cfm: line 16

    14 : INNER JOIN Categories
    15 :     ON merchSubCat.CategoryID = Categories.CategoryID
    16 : WHERE merchSubCat.subID = <cfqueryparam value="#url.CategoryID#" cfsqltype="cf_sql_integer">
    17 : </cfquery>
    18 : 
    

    I don't see what I did wrong, another pair of eyes can see where I missed something?

    Thank you

    I think that you just want to use the URL. CategoryID parameter:


    Ken Ford

  • SELECT - INNER JOIN / multi-table question

    I have a few pages where I can:
    register a new user
    Open as this user which brings me to a home page. from there I can go to 'my page' users where I can see their fine of the initial registry data. I have a link here where I can go to add to their additional profile data that I didn't want to bore in the original registration.

    It perfect all worked with the original test data, I've created in the database.

    After that I added the additional tables needed to feed the profile further I ran into trouble. I could create a new user, see in the database is fine. I see them on the homepage with their information through the Recordset. However when I'd go to their 'my page' none of their information would be fill and go to extra profile update page haven't fired a no records found message.

    Finally, I realized that the reason for this is because the SELECT statement is waiting for the other tables to fill. I filled in the missing data and the query to work. So... Now that I know what is causing the problem I need help to find a solution. Also, I'm still new to find work around me even after 4 days of research and reading messages.

    So when a new user registers, I need to be able to display data from the initial registration on the "my page" and get their user_id for profile tables add somehow so that when I go to the add profile page, there is a link.

    I don't know if I need to do something in the database or in my query. It there any sense to anyone? I need to create the user_id on other tables during registration of origin occurs? If so, how would I go all this?

    Thanks in advance. My INNER JOIN is attached in case it helps.

    I have a few pages where I can:
    register a new user
    Open as this user which brings me to a home page. from there I can go to 'my page' users where I can see their fine of the initial registry data. I have a link here where I can go to add to their additional profile data that I didn't want to bore in the original registration.

    It perfect all worked with the original test data, I've created in the database.

    After that I added the additional tables needed to feed the profile further I ran into trouble. I could create a new user, see in the database is fine. I see them on the homepage with their information through the Recordset. However when I'd go to their 'my page' none of their information would be fill and go to extra profile update page haven't fired a no records found message.

    Finally, I realized that the reason for this is because the SELECT statement is waiting for the other tables to fill. I filled in the missing data and the query to work. So... Now that I know what is causing the problem I need help to find a solution. Also, I'm still new to find work around me even after 4 days of research and reading messages.

    So when a new user registers, I need to be able to display data from the initial registration on the "my page" and get their user_id for profile tables add somehow so that when I go to the add profile page, there is a link.

    I don't know if I need to do something in the database or in my query. It there any sense to anyone? I need to create the user_id on other tables during registration of origin occurs? If so, how would I go all this?

    Thanks in advance. My INNER JOIN is attached in case it helps.

  • Problem with Outer join and filter

    Hello

    I join two tables in the source using a left outer join. Outside of the join, I have a filter specified with condition TabA.C1 > TabB.C2.

    Now, when ODI generates the query it puts the left outer join on the filter condition as well. So he puts filter as

    where
    (1 = 1)
    And ((TabA.C1 = TabB.C1 (+)) AND)
    (TabA.C2 = TabB.C2 (+))
    And TabA.C10 > TabB.C14 (+)

    How to avoid this problem. I tried this performance on stage as well, always generated query remains the same.

    I use the incremental update of the IKM Oracle. My source and target are both on the same PB.


    ~ Chikk

    Hi Chikk,

    If you analyze the data, you'll see it's OK to have the "(+)" to the filter...

    Anyway, if you want to drop it, leave it as inner join and put the "(+)" manually to the join object.

    This help you?

  • Something wrong with this JOIN?

    DB version: 11.2

    I'm trying to join the tables TBS_FILE_INFO and FREE_SPACE_INFO below.

    Info on the data stored in these 2 tables:

    ==========================================

    TBS_FILE_INFO is a kind of a master table that stores information about each file and its size in a tablespace. Almost all 30 GB in size.

    Each file consists of several extensions. FREE_SPACE_INFO table stores information about the free space left in extensions in a file.

    My requirement is simple. I just need that information returned by 2 queries below (but a query).

    SQL > select sum (SIZEGB) TotalAllocatedGB from tbs_file_info where nom_tablespace = 'SIEBEL_TABLES ';

    TOTALALLOCATEDGB

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

    450

    SQL > select sum (FREEGB) free_gb from free_space_info where nom_tablespace = 'SIEBEL_TABLES ';

    FREE_GB

    ----------

    206.999329

    To get this data in a single request, I associate myself with these 2 tables using the FILE_ID column.

    Output is shown below.

    The FREE_GB info is correct, but the value of TotalAllocatedGB 10170 (indicated in red below) is not correct . It should be 450 GB as shown above. No idea why?

    Select

    TFI.tablespace_name,

    Sum (SIZEGB) TotalAllocatedGB,

    the sum of Free_GB (FREEGB)

    from tbs_file_info INNER JOIN free_space_info ISP tfi

    on (tfi.file_id = fsi.file_id)

    where tfi.tablespace_name = 'SIEBEL_TABLES. '

    and tfi.tablespace_name = fsi.tablespace_name - it's condition AND no difference

    Tfi.tablespace_name group;

    NOM_TABLESPACE TOTALALLOCATEDGB FREE_GB

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

    10170 206.999329 SIEBEL_TABLES

    -Here is the data

    -What is there all I could attach .sql files to this post? I couldn't fix the photo option and video

    SQL > select * from tbs_file_info;

    FILE_ID SIZEGB NOM_TABLESPACE

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

    18 30 SBL_S_ORDER_ITEM_IDX

    53 5 SBL_S_ORDER_ITEM_IDX

    52 30 SBL_S_ORDER_ITEM_IDX

    63 30 SIEBEL_TABLES

    64 30 SIEBEL_TABLES

    74 30 SIEBEL_TABLES

    66 30 SIEBEL_TABLES

    67 30 SIEBEL_TABLES

    68 30 SIEBEL_TABLES

    SIEBEL_TABLES 69 30

    SIEBEL_TABLES 70 30

    71 30 SIEBEL_TABLES

    72 30 SIEBEL_TABLES

    73 30 SIEBEL_TABLES

    62 30 SIEBEL_TABLES

    61 30 SIEBEL_TABLES

    7 30 SIEBEL_TABLES

    SIEBEL_TABLES 65 30

    18 selected lines.

    SQL > select * from free_space_info;

    FILE_ID EXTENT_ID FREEGB NUM_OF_BLOCKS NOM_TABLESPACE

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

    18 2031744 SBL_S_ORDER_ITEM_IDX 3.875 507904

    18 1523840 SBL_S_ORDER_ITEM_IDX 3.875 507904

    18 1015936 SBL_S_ORDER_ITEM_IDX 3.875 507904

    18 508032 SBL_S_ORDER_ITEM_IDX 3.875 507904

    18 333312 1.33300781 SBL_S_ORDER_ITEM_IDX 174720

    18 3047552 SBL_S_ORDER_ITEM_IDX 3.875 507904

    18 2539648 SBL_S_ORDER_ITEM_IDX 3.875 507904

    18 3555456 2.87402344 SBL_S_ORDER_ITEM_IDX 376704

    52 3555456 2.87402344 SBL_S_ORDER_ITEM_IDX 376704

    52 3047552 SBL_S_ORDER_ITEM_IDX 3.875 507904

    52 2031744 SBL_S_ORDER_ITEM_IDX 3.875 507904

    52 1523840 SBL_S_ORDER_ITEM_IDX 3.875 507904

    52 1015936 SBL_S_ORDER_ITEM_IDX 3.875 507904

    52 508032 SBL_S_ORDER_ITEM_IDX 3.875 507904

    52 333824 1.32910156 SBL_S_ORDER_ITEM_IDX 174208

    52 326528 128.000976563 SBL_S_ORDER_ITEM_IDX

    52 248184 8.000061035 SBL_S_ORDER_ITEM_IDX

    52 2539648 SBL_S_ORDER_ITEM_IDX 3.875 507904

    53 12800 3.77832031 SBL_S_ORDER_ITEM_IDX 495232

    53 508032 1.12402344 SBL_S_ORDER_ITEM_IDX 147328

    SIEBEL_TABLES 7 1542144.00390625 512

    SIEBEL_TABLES 7 2246528.000976563 128

    SIEBEL_TABLES 7 2247680.03515625 4608

    SIEBEL_TABLES 7 2586112.0625 8192

    SIEBEL_TABLES 7 2703872.0625 8192

    SIEBEL_TABLES 7 2824192.0625 8192

    SIEBEL_TABLES 7 581504.000976563 128

    SIEBEL_TABLES 7 1070720.002929688 384

    SIEBEL_TABLES 61 2806272.0625 8192

    61 571776 128.000976563 SIEBEL_TABLES

    SIEBEL_TABLES 61 2692608.0625 8192

    SIEBEL_TABLES 61 2576000.061523438 8064

    SIEBEL_TABLES 61 1062272.000976563 128

    62 538752 384.002929688 SIEBEL_TABLES

    62 1395968 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 62 1756032.000976563 128

    62 2090624 384.002929688 SIEBEL_TABLES

    SIEBEL_TABLES 62 2554880.02734375 3584

    SIEBEL_TABLES 62 2788352.0625 8192

    SIEBEL_TABLES 62 2667008.0625 8192

    SIEBEL_TABLES 63 642176.002929688 384

    63 2541312 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 63 2543616.04296875 5632

    SIEBEL_TABLES 63 2657792.0625 8192

    SIEBEL_TABLES 63 2771968.0625 8192

    SIEBEL_TABLES 64 2644608.030273438 3968

    64 2302208 256.001953125 SIEBEL_TABLES

    64 1965952 128.000976563 SIEBEL_TABLES

    64 1108864 128.000976563 SIEBEL_TABLES

    64 619904 128.000976563 SIEBEL_TABLES

    SIEBEL_TABLES 64 2759680.0625 8192

    65 3811456 384.002929688 SIEBEL_TABLES

    SIEBEL_TABLES 65 3812736.000976563 128

    SIEBEL_TABLES 65 3813248.000976563 128

    65 3813760 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 65 3814656.000976563 128

    SIEBEL_TABLES 65 3814912.000976563 128

    SIEBEL_TABLES 65 3815680.000976563 128

    SIEBEL_TABLES 65 3815936.000976563 128

    65 3816704 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 65 3826432.000976563 128

    SIEBEL_TABLES 65 3827328.000976563 128

    SIEBEL_TABLES 65 3827968.000976563 128

    SIEBEL_TABLES 65 3828352.000976563 128

    65 3876992 384.002929688 SIEBEL_TABLES

    SIEBEL_TABLES 65 3926528.04296875 5632

    65 3810432 384.002929688 SIEBEL_TABLES

    SIEBEL_TABLES 65 3801472.000976563 128

    SIEBEL_TABLES 65 3801216.000976563 128

    65 3792640 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 65 3792384.000976563 128

    SIEBEL_TABLES 65 3792000.000976563 128

    SIEBEL_TABLES 65 3791616.000976563 128

    65 3791232 256.001953125 SIEBEL_TABLES

    65 3790592 256.001953125 SIEBEL_TABLES

    65 3789952 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 65 3788416.000976563 128

    SIEBEL_TABLES 65 3788032.000976563 128

    SIEBEL_TABLES 65 3787520.000976563 128

    SIEBEL_TABLES 65 3787264.000976563 128

    SIEBEL_TABLES 65 3302912.0078125 1024

    SIEBEL_TABLES 65 3295744.0078125 1024

    SIEBEL_TABLES 65 3279360.0078125 1024

    SIEBEL_TABLES 65 3266048.0078125 1024

    SIEBEL_TABLES 65 3257856.0078125 1024

    SIEBEL_TABLES 65 3216896.0078125 1024

    65 3192832 512.00390625 SIEBEL_TABLES

    65 3042944 384.002929688 SIEBEL_TABLES

    SIEBEL_TABLES 65 128.002929688 384

    65 667264 384.002929688 SIEBEL_TABLES

    SIEBEL_TABLES 66 61952.00390625 512

    66 65536 512.00390625 SIEBEL_TABLES

    66 78336 512.00390625 SIEBEL_TABLES

    66 80896 512.00390625 SIEBEL_TABLES

    66 92672 512.00390625 SIEBEL_TABLES

    66 96256 512.00390625 SIEBEL_TABLES

    66 98816 512.00390625 SIEBEL_TABLES

    SIEBEL_TABLES 66 102400.000976563 128

    SIEBEL_TABLES 66 109056.0078125 1024

    66 132608 1024.0078125 SIEBEL_TABLES

    66 164352 1024.0078125 SIEBEL_TABLES

    SIEBEL_TABLES 66 180736.0078125 1024

    66 187904 1024.0078125 SIEBEL_TABLES

    SIEBEL_TABLES 66 204288.0078125 1024

    SIEBEL_TABLES 66 218624.0078125 1024

    66 224768 1024.0078125 SIEBEL_TABLES

    SIEBEL_TABLES 66 264704.0078125 1024

    SIEBEL_TABLES 66 271360.0078125 1024

    SIEBEL_TABLES 66 293888.0078125 1024

    66 296192 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 66 300544.0078125 1024

    66 305664 512.00390625 SIEBEL_TABLES

    SIEBEL_TABLES 66 307200.01171875 1536

    66 312832 1536.01171875 SIEBEL_TABLES

    66 315392 512.00390625 SIEBEL_TABLES

    66 327168 512.00390625 SIEBEL_TABLES

    SIEBEL_TABLES 66 360448.0078125 1024

    SIEBEL_TABLES 66 361728.000976563 128

    SIEBEL_TABLES 66 365056.000976563 128

    SIEBEL_TABLES 66 365312.000976563 128

    SIEBEL_TABLES 66 366592.000976563 128

    SIEBEL_TABLES 66 366848.000976563 128

    SIEBEL_TABLES 66 367104.000976563 128

    SIEBEL_TABLES 66 367360.000976563 128

    SIEBEL_TABLES 66 369664.008789063 1152

    SIEBEL_TABLES 66 370944.000976563 128

    SIEBEL_TABLES 66 373248.0078125 1024

    66 377344 1024.0078125 SIEBEL_TABLES

    66 380928 1024.0078125 SIEBEL_TABLES

    SIEBEL_TABLES 66 384512.0078125 1024

    SIEBEL_TABLES 66 396288.0078125 1024

    SIEBEL_TABLES 66 408064.0078125 1024

    SIEBEL_TABLES 66 411136.0078125 1024

    SIEBEL_TABLES 66 415744.0078125 1024

    SIEBEL_TABLES 66 418304.0078125 1024

    SIEBEL_TABLES 66 423424.0078125 1024

    SIEBEL_TABLES 66 452096.0078125 1024

    SIEBEL_TABLES 66 463360.0078125 1024

    SIEBEL_TABLES 66 476672.0078125 1024

    SIEBEL_TABLES 66 478208.0078125 1024

    66 484352 2048.015625 SIEBEL_TABLES

    66 491520 2048.015625 SIEBEL_TABLES

    66 500736 2048.015625 SIEBEL_TABLES

    66 527872 2048.015625 SIEBEL_TABLES

    SIEBEL_TABLES 66 543744.0078125 1024

    SIEBEL_TABLES 66 545792.0078125 1024

    66 569344 2048.015625 SIEBEL_TABLES

    66 576512 2048.015625 SIEBEL_TABLES

    SIEBEL_TABLES 66 600064.0078125 1024

    SIEBEL_TABLES 66 603136.0078125 1024

    SIEBEL_TABLES 66 609280.0078125 1024

    SIEBEL_TABLES 66 616448.0078125 1024

    SIEBEL_TABLES 66 623616.0078125 1024

    SIEBEL_TABLES 66 671232.0078125 1024

    SIEBEL_TABLES 66 680448.0078125 1024

    SIEBEL_TABLES 66 689664.0078125 1024

    66 705024 1024.0078125 SIEBEL_TABLES

    SIEBEL_TABLES 66 720896.0078125 1024

    SIEBEL_TABLES 66 728064.0078125 1024

    66 742400 1024.0078125 SIEBEL_TABLES

    SIEBEL_TABLES 66 775168.0078125 1024

    SIEBEL_TABLES 66 791552.0078125 1024

    SIEBEL_TABLES 66 1262976.000976563 128

    SIEBEL_TABLES 66 1263360.000976563 128

    SIEBEL_TABLES 66 1263872.000976563 128

    SIEBEL_TABLES 66 1264384.000976563 128

    SIEBEL_TABLES 66 1264640.000976563 128

    SIEBEL_TABLES 66 1264896.000976563 128

    SIEBEL_TABLES 66 1265536.000976563 128

    SIEBEL_TABLES 66 1266176.000976563 128

    SIEBEL_TABLES 66 1266560.000976563 128

    SIEBEL_TABLES 66 1266816.000976563 128

    66 1267072 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 66 1267968.000976563 128

    66 1277312 128.000976563 SIEBEL_TABLES

    66 1278336 256.001953125 SIEBEL_TABLES

    66 1278720 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 66 1279488.000976563 128

    SIEBEL_TABLES 66 1279744.000976563 128

    SIEBEL_TABLES 66 1280384.000976563 128

    66 1280640 128.000976563 SIEBEL_TABLES

    SIEBEL_TABLES 66 1281024.000976563 128

    SIEBEL_TABLES 66 1281664.000976563 128

    66 1282304 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 66 1282944.000976563 128

    SIEBEL_TABLES 66 1283200.000976563 128

    SIEBEL_TABLES 66 1283584.000976563 128

    SIEBEL_TABLES 66 1284480.000976563 128

    SIEBEL_TABLES 66 1285120.000976563 128

    SIEBEL_TABLES 66 1285376.000976563 128

    SIEBEL_TABLES 66 1285760.000976563 128

    66 1376512 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 66 1523840.002929688 384

    SIEBEL_TABLES 66 2031744.002929688 384

    66 2808320 1.82519531 SIEBEL_TABLES 239232

    66 3047552 SIEBEL_TABLES 3.875 507904

    66 3555456 2.87402344 SIEBEL_TABLES 376704

    SIEBEL_TABLES 66 2711376.000061035 8

    SIEBEL_TABLES 66 2711384.000061035 8

    SIEBEL_TABLES 66 2711352.000061035 8

    SIEBEL_TABLES 66 2711360.000061035 8

    SIEBEL_TABLES 66 2711368.000061035 8

    SIEBEL_TABLES 66 2711328.000061035 8

    SIEBEL_TABLES 66 2711336.000061035 8

    SIEBEL_TABLES 66 2711344.000061035 8

    SIEBEL_TABLES 66 2711320.000061035 8

    67 89472 128.000976563 SIEBEL_TABLES

    67 91008 128.000976563 SIEBEL_TABLES

    67 91392 128.000976563 SIEBEL_TABLES

    67 91776 128.000976563 SIEBEL_TABLES

    67 93056 128.000976563 SIEBEL_TABLES

    67 93312 128.000976563 SIEBEL_TABLES

    67 93696 128.000976563 SIEBEL_TABLES

    67 93952 256.001953125 SIEBEL_TABLES

    67 94464 128.000976563 SIEBEL_TABLES

    67 94720 128.000976563 SIEBEL_TABLES

    67 95104 128.000976563 SIEBEL_TABLES

    SIEBEL_TABLES 67 95360.000976563 128

    67 95616 128.000976563 SIEBEL_TABLES

    67 95872 128.000976563 SIEBEL_TABLES

    67 96640 128.000976563 SIEBEL_TABLES

    67 97408 384.002929688 SIEBEL_TABLES

    67 98304 128.000976563 SIEBEL_TABLES

    67 98560 256.001953125 SIEBEL_TABLES

    67 99456 384.002929688 SIEBEL_TABLES

    67 100096 128.000976563 SIEBEL_TABLES

    67 101376 128.000976563 SIEBEL_TABLES

    67 101760 128.000976563 SIEBEL_TABLES

    67 102528 256.001953125 SIEBEL_TABLES

    67 103168 128.000976563 SIEBEL_TABLES

    67 103552 128.000976563 SIEBEL_TABLES

    67 104192 128.000976563 SIEBEL_TABLES

    67 104960 128.000976563 SIEBEL_TABLES

    67 105984 128.000976563 SIEBEL_TABLES

    67 106752 128.000976563 SIEBEL_TABLES

    67 248192 128.000976563 SIEBEL_TABLES

    67 508032 384.002929688 SIEBEL_TABLES

    67 1015936 384.002929688 SIEBEL_TABLES

    67 1632640 3.04492188 SIEBEL_TABLES 399104

    67 2031744 SIEBEL_TABLES 3.875 507904

    67 2539648 SIEBEL_TABLES 3.875 507904

    67 3047552 SIEBEL_TABLES 3.875 507904

    67 3555456 2.87402344 SIEBEL_TABLES 376704

    67 1537936 8.000061035 SIEBEL_TABLES

    67 1537792 8.000061035 SIEBEL_TABLES

    67 1537800 8.000061035 SIEBEL_TABLES

    67 1537920 8.000061035 SIEBEL_TABLES

    67 1537928 8.000061035 SIEBEL_TABLES

    67 1537680 8.000061035 SIEBEL_TABLES

    67 1537688 8.000061035 SIEBEL_TABLES

    67 1537696 8.000061035 SIEBEL_TABLES

    67 1537176 8.000061035 SIEBEL_TABLES

    67 1537664 8.000061035 SIEBEL_TABLES

    67 1537672 8.000061035 SIEBEL_TABLES

    67 1523840 128.000976563 SIEBEL_TABLES

    67 1537168 8.000061035 SIEBEL_TABLES

    SIEBEL_TABLES 68 128.002929688 384

    SIEBEL_TABLES 68 508032.002929688 384

    68 1176992 2.64624023 SIEBEL_TABLES 346848

    68 1523840 SIEBEL_TABLES 3.875 507904

    68 2031744 SIEBEL_TABLES 3.875 507904

    68 2539648 SIEBEL_TABLES 3.875 507904

    68 3047552 SIEBEL_TABLES 3.875 507904

    68 3555456 2.87402344 SIEBEL_TABLES 376704

    SIEBEL_TABLES 68 1016064.000976563 128

    SIEBEL_TABLES 69 128.002929688 384

    69 849408 1.27050781 SIEBEL_TABLES 166528

    69 1015936 SIEBEL_TABLES 3.875 507904

    69 1523840 SIEBEL_TABLES 3.875 507904

    69 2031744 SIEBEL_TABLES 3.875 507904

    69 2539648 SIEBEL_TABLES 3.875 507904

    69 3047552 SIEBEL_TABLES 3.875 507904

    69 3555456 2.87402344 SIEBEL_TABLES 376704

    69 508160 128.000976563 SIEBEL_TABLES

    SIEBEL_TABLES 70 128.002929688 384

    70 607232 3.11816406 SIEBEL_TABLES 408704

    70 1015936 SIEBEL_TABLES 3.875 507904

    70 1523840 SIEBEL_TABLES 3.875 507904

    70 2031744 SIEBEL_TABLES 3.875 507904

    70 2539648 SIEBEL_TABLES 3.875 507904

    70 3047552 SIEBEL_TABLES 3.875 507904

    70 3555456 2.87402344 SIEBEL_TABLES 376704

    SIEBEL_TABLES 70 530056.000061035 8

    70 530064 8.000061035 SIEBEL_TABLES

    SIEBEL_TABLES 70 529824.000061035 8

    SIEBEL_TABLES 70 530048.000061035 8

    SIEBEL_TABLES 70 508032.000976563 128

    71 435456 256.001953125 SIEBEL_TABLES

    SIEBEL_TABLES 71 436736.543945313 71296

    71 508032 SIEBEL_TABLES 3.875 507904

    71 1015936 SIEBEL_TABLES 3.875 507904

    71 1523840 SIEBEL_TABLES 3.875 507904

    71 2031744 SIEBEL_TABLES 3.875 507904

    71 2539648 SIEBEL_TABLES 3.875 507904

    71 3047552 SIEBEL_TABLES 3.875 507904

    71 3555456 2.87402344 SIEBEL_TABLES 376704

    SIEBEL_TABLES 71 128.000976563 128

    SIEBEL_TABLES 71 363896.000061035 8

    72 373376 1.02734375 SIEBEL_TABLES 134656

    508032 72 SIEBEL_TABLES 3.875 507904

    1015936 72 SIEBEL_TABLES 3.875 507904

    1523840 72 SIEBEL_TABLES 3.875 507904

    2031744 72 SIEBEL_TABLES 3.875 507904

    2539648 72 SIEBEL_TABLES 3.875 507904

    3047552 72 SIEBEL_TABLES 3.875 507904

    72 3555456 2.87402344 SIEBEL_TABLES 376704

    72 259872 8.000061035 SIEBEL_TABLES

    72 259880 8.000061035 SIEBEL_TABLES

    72 259888 8.000061035 SIEBEL_TABLES

    SIEBEL_TABLES 72 384.000976563 128

    72 259856 8.000061035 SIEBEL_TABLES

    72 259864 8.000061035 SIEBEL_TABLES

    SIEBEL_TABLES 72 256.000976563 128

    72 259840 8.000061035 SIEBEL_TABLES

    72 259848 8.000061035 SIEBEL_TABLES

    SIEBEL_TABLES 72 128.000976563 128

    72 259616 8.000061035 SIEBEL_TABLES

    73 315776 128.000976563 SIEBEL_TABLES

    73 316928 1.45800781 SIEBEL_TABLES 191104

    73 508032 SIEBEL_TABLES 3.875 507904

    73 1015936 SIEBEL_TABLES 3.875 507904

    73 1523840 SIEBEL_TABLES 3.875 507904

    73 2031744 SIEBEL_TABLES 3.875 507904

    73 2539648 SIEBEL_TABLES 3.875 507904

    73 3047552 SIEBEL_TABLES 3.875 507904

    73 3555456 2.87402344 SIEBEL_TABLES 376704

    73 195512 8.000061035 SIEBEL_TABLES

    73 195488 8.000061035 SIEBEL_TABLES

    73 195496 8.000061035 SIEBEL_TABLES

    73 195504 8.000061035 SIEBEL_TABLES

    SIEBEL_TABLES 73 128.000976563 128

    73 195464 8.000061035 SIEBEL_TABLES

    73 195472 8.000061035 SIEBEL_TABLES

    73 195480 8.000061035 SIEBEL_TABLES

    73 195248 8.000061035 SIEBEL_TABLES

    73 195256 8.000061035 SIEBEL_TABLES

    73 195456 8.000061035 SIEBEL_TABLES

    73 195240 8.000061035 SIEBEL_TABLES

    74 258304 256.001953125 SIEBEL_TABLES

    74 267776 1.83300781 SIEBEL_TABLES 240256

    74 508032 SIEBEL_TABLES 3.875 507904

    74 1015936 SIEBEL_TABLES 3.875 507904

    74 1523840 SIEBEL_TABLES 3.875 507904

    74 2031744 SIEBEL_TABLES 3.875 507904

    74 2539648 SIEBEL_TABLES 3.875 507904

    74 3047552 SIEBEL_TABLES 3.875 507904

    74 3555456 2.87402344 SIEBEL_TABLES 376704

    74 131344 8.000061035 SIEBEL_TABLES

    74 130536 8.000061035 SIEBEL_TABLES

    74 130544 8.000061035 SIEBEL_TABLES

    74 131328 8.000061035 SIEBEL_TABLES

    74 131336 8.000061035 SIEBEL_TABLES

    74 130512 8.000061035 SIEBEL_TABLES

    74 130520 8.000061035 SIEBEL_TABLES

    74 130528 8.000061035 SIEBEL_TABLES

    74 130488 8.000061035 SIEBEL_TABLES

    74 130496 8.000061035 SIEBEL_TABLES

    74 130504 8.000061035 SIEBEL_TABLES

    74 130480 8.000061035 SIEBEL_TABLES

    Hello

    Thanks for posting the sample data.

    In your first post, you said:

    URS wrote:

    ...

    SQL > select sum (FREEGB) free_gb from free_space_info where nom_tablespace = 'SIEBEL_TABLES ';

    FREE_GB

    ----------

    206.999329

    ...

    When I run this query with your sample data, I get:

    FREE_GB

    ----------

    .69140625

    If the largest number is really what you want, explain, step-by-step, how get you from the given sample data.

    I got some wrong in response #2 identifiers.  What I wanted to post was:

    WITH file_summary AS

    (

    SELECT SUM (sizegb) AS TotlAllocatedGB

    nom_tablespace

    OF tbs_file_info

    GROUP BY tablespace_name

    )

    SELECT fi.tablespace_name

    ,         fi. TotlAllocatedGB

    SUM (fr.freegb) AS FreeGB

    File_summary FI

    JOIN free_space_info en on fr.tablespace_name = fi.tablespace_name

    WHERE fi.tablespace_name = 'SIEBEL_TABLES. '

    GROUP BY fi.tablespace_name

    ,         fi. TotlAllocatedGB

    ;

    Output of your sample data:

    NOM_TABLESPACE TOTLALLOCATEDGB FREEGB

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

    SIEBEL_TABLES 450.69140625

Maybe you are looking for

  • Why the iPhone 5 c suddenly unload its battery

    This has happened at least half a dozen times now. My phone is off, not in use, not invited, for hours and hours, having been charged or capacity load almost yesterday. It's on a Verizon network. I'll check, and the phone is dead, the battery complet

  • Mail carrier arrives in a new tab instead of the home page

    Recently I met a change when I open a new tab. Instead of the home page (as was the case previously) I get my carrier of electronic mail (e-mail) white page with an illustrated history of the last visited web sites. The statement tab in Windows shoul

  • My old Apple ID is inactive. How can I deactivate find my iPhone application?

    I have a new iPhone. To transfer the data, I need to disable "find my iPhone". my ID Apple for iCloud is inactive and I forgot the password. I have the new Apple ID. What can I do to avoid losing my data?

  • OSX computer

    I was contacted by 888 220 1478 saying OSX computer & Safari has allowed maximum pop, they gave me a computer ID when I rang they wanted details and offered repair online... What is an Apple Service? Investigate apple?

  • 600 SATA or SATA 300 to replace hard drive for CTOs dv6-3100

    Hello My laptop has been giving a "SMART test failed" message for the past few days and I have copied all the data on my external hard drive. My current hard drive is a Samsung HM640JJ. I noticed that there are SATA-300 interface. I think of buying: