Reorder with just a single Query?

If I have a table like
ID | Desc | Sortorder
1 One 3
4 Two 2
6 Three 1
Is there a way I can use a single query to change the Sortorder to 1,2,3 based on my ORDER BY ID without having to write a script?

and a complete example
SQL> create table   x as
  2  (
  3  select 1 id, 'One' descr,  3 sortorder from dual union all
  4  select 4 id, 'Two' descr,  2 sortorder from dual union all
  5  select 6 id, 'Three' descr,  1 sortorder from dual
  6  )
  7  /
Table created.
SQL> select *
  2    from x
  3  /
        ID DESCR  SORTORDER
         1 One            3
         4 Two            2
         6 Three          1
SQL> merge into x
  2  using (
  3  select id
  4       , row_number() over (order by id
  5                           ) rn
  6       , rowid rid
  7    from x) x_orig
  8   on (x.rowid = x_orig.rid)
  9   when matched then
10   update set sortorder = x_orig.rn
11  /
3 rows merged.
SQL> select *
  2    from x
  3  /
        ID DESCR  SORTORDER
         1 One            1
         4 Two            2
         6 Three          3

Similar Messages

  • How to Filter a filtered Query with in a single query

    Hi all,
    Thanks in advance , Below is the query
    SELECT *
    FROM
    (SELECT MitarbeiterListe.IDMITARBEITERLISTE,
    MITARBEITERLISTE.JAHR ,
    MITARBEITERLISTE.mitarbeiter ,
    FIRMA.FIRMA ,
    Abteilung.Abteilung ,
    MitarbeiterStatus.mitarbeiterstatus ,
    MitarbeiterListe.OEVON ,
    MitarbeiterListe.OEBIS ,
    MitarbeiterListe.SAPPERSNR ,
    MitarbeiterListe.EKPreis
    ||'.00' "MitarbeiterListe.EKPreis",
    MitarbeiterListe.InfrastrukturkostenZuschlag
    ||'.00' "InfrastrukturkostenZuschlag",
    MitarbeiterListe.VerwaltungskostenZuschlag*100
    ||'%' "VerwaltungskostenZuschlag",
    MitarbeiterListe.Tagessatz ,
    MitarbeiterListe.Arbeitsort ,
    MitarbeiterListe.Titel ,
    MitarbeiterListe.Bemerkung ,
    BERECHTIGUNGEN.BENUTZERNAME
    FROM Firma
    INNER JOIN (Abteilung
    INNER JOIN MitarbeiterListe
    ON Abteilung.IDAbteilung = MitarbeiterListe.IDAbteilung
    INNER JOIN MitarbeiterStatus
    ON MitarbeiterListe.IDMITARBEITERSTATUS=MitarbeiterStatus.IDMITARBEITERSTATUS
    INNER JOIN BERECHTIGUNGEN
    ON MITARBEITERLISTE.IDBEARBEITER=BERECHTIGUNGEN.IDBENUTZER )
    ON Firma.IDFirma = MitarbeiterListe.IDFirma
    WHERE MitarbeiterListe.Jahr = :P9_SEL_JAHR
    AND Abteilung.IDOE =
    ( SELECT IDOE FROM OE WHERE OE = :P9_SEL_OE AND JAHR = :P9_SEL_JAHR
    ) temp
    Requirement is : we need to filter this query again based on column in select list . As using AND / OR operator we are not able to give desired result ..
    As in our case we are filtering the above query based on :P9_SEL_JAHR and :P9_SEL_OE variables ther is further requirement that we can also filter the filtered given query based on column vaue so we can get the specific columns value through bind variables and can use OR operator between them .but the problem is coming on merging the columns where case with the given query ..
    As for example if we use this afer the query
    OR/AND
    MitarbeiterStatus.mitarbeiterstatus = :P9_SL_MA_STAT OR
    MitarbeiterListe.OEVON = :P9_SL_OEVON OR
    MitarbeiterListe.OEBIS = :P9_SL_OEBIS OR
    MitarbeiterListe.SAPPERSNR = :P9_SL_SAPPERNR
    for the OR case the first query will be always true so it will not filter it baseed on column value and in case of AND the second query would return true ..so we would get filtered column value based on column bind varaible not the complete query result based on JAHR and OE bind variable.
    any way to satisfy these two cases within a single query ..suggesstions are welcomed and would be truly appreciated.
    Cheers
    sachin

    Not certain I've fully understood your required logic without examples, but I think you just need to use brackets:
    WHERE MitarbeiterListe.Jahr = :P9_SEL_JAHR
    AND Abteilung.IDOE =
    ( SELECT IDOE FROM OE WHERE OE = :P9_SEL_OE AND JAHR = :P9_SEL_JAHR)
    AND
    MitarbeiterStatus.mitarbeiterstatus = :P9_SL_MA_STAT
    OR MitarbeiterListe.OEVON = :P9_SL_OEVON
    OR MitarbeiterListe.OEBIS = :P9_SL_OEBIS
    OR MitarbeiterListe.SAPPERSNR = :P9_SL_SAPPERNR
    )

  • Can this be done by just a single query alone ?

    hi ,
    I have the following data
    id , type1 , duration, status
    1 a 2 R
    1 a 3 R
    1 a 2 I
    i need to become a single record as follows
    id , type total , total_R , total I
    1 a 7 4 2
    partitition by does not allow where clause
    besides 1st creating a table and then update the fields , is this possible in just using 1 query (besides unioning several query for total_R , total_I) ?
    pls advise
    tks & rgds

    select id , case when type like '%I' then sum(time1)
    end case total_1
    group by id , -- if i do not speciy type it won't
    work but what i want is a total over each different
    idpls adviseSum should come outside the case statment. Try this
    select id , sum(case when type like '%I' then time1 end) total_1
    group by id There is no performance difference between case and decode.

  • Is it possible with just "SQL"

    Hi everyone,
    I have a LOCAL TABLE with the following structure ..
    EX:
    TABLE_ID 1
    EMPNO 1234
    LAST_NM JOHN
    FIRST_NM SMITH
    DOB 06/05/1982
    I have another TABLE which is in TRASACTIONAL DATABASE (which has million rows)
    I have access to this table with a database link..
    EX:
    EMPNO 1234
    LAST_NM JOHN
    FIRST_NM SMITH
    DOB 06/05/1982
    I am trying to write a query which search for EMPLOYEE last_nm... But first it has search in the LOCAL TABLE if it doesnt find over there it hase hit the TRANSACTIONAL TABLE and get the   results back
    EX:
    If i search for LAST_NM as "JOHN"... I have JOHN in the LOCAL TABLE.. so the output would be like the following..
    TABLE_ID EMPNO LAST_NM FIRST_NM DOB
    1 1234 JOHN SMITH 06/05/1982
    But if search for LAST_NM as "FORD".... I dont have it in the LOCAL TABLE..so the output would be like the following..
    TABLE_ID EMPNO LAST_NM FIRS_NM DOB
    NULL 5435 FORD STEVE 08/09/1973
    If i dont give any search parameter ..it has give the output of all the employees in the LOCAL_TABLE....
    IS it Possible to do With Just a SQL query..without using any PL/SQL....
    Thanks in advance for the help
    phani

    SELECT *
    FROM local_table
    WHERE last_name = 'JOHN'
    UNION
    SELECT *
    FROM remote_table
    WHERE NOT EXISTS ( SELECT 1
    FROM local_table
    WHERE last_name = 'JOHN' ) AND last_name = 'JOHN' ;{code}                                                                                                                                                                                                                                                                                                                                                                                                           

  • Single report with multiple queries OR multiple reports with single query

    Hello Experts,
    I have a confusion regarding Live Office connection for many days. I asked many people but did not get a concrete answer. I am re-posting this question here and expecting an answer this time.
    The product versions that I am using are as follows:
    FrontEnd:
      BOE XI 3.1 SP4 FP 4.1
      Xcelsius Enterprise 2008 SP4
    Backend:
      SAP BW 7.0 EHP1
    I have created a dashboard which is getting data from a webi report using LO connections.
    The webi report has five report parts which are populated by five different queries.
    Now my question is, when the five LO connections are refreshed, is the webi report refreshed five times or just once?
    If the report is refreshed five times, then I guess it is better to have five different webi reports containing single report part, because in that way we can prevent same query being executed multiple times.
    SO what is the best practice- to have a single report having multiple queries - OR - to create multiple webi reports with single query?
    Thanks and Regards,
    PASG

    HI
    I think Best Practice is Multiple reports with single query
    Any way If LO connections refresh 5 time the query will refresh 5 timesRegards
    Venkat

  • Writing single query with conflicting WHERE statements

    How do I run the following as a single query that will result in a column that pertains to the first block of code and then another column that pertains to the 2nd block of code? The issue is that I need 2 different WHERE statements. So the final output will be patient_id, complete, incomplete.
    SELECT patient_id, COUNT(*) AS complete
    FROM STATUS
    WHERE status = 1
    GROUP BY patient_id
    ORDER BY patient_id;
    SELECT patient_id, COUNT(*) AS incomplete
    FROM STATUS
    WHERE status = 2
    GROUP BY patient_id
    ORDER BY patient_id;
    Thanks!

    Hi,
    apex wrote:
    Thanks for all of the help.
    I would like to add another column with decile and am struggling as to how to do it. Since I can't reference something in a calculation in the same step, I think I will need a 3rd nesting, but what I haven't figured out is how to get the number of subjects whose ratio is less than that subject's ratio. Right: you can't assign an alias (such as complete or ratio) to a calculated column and use that alias in the same sub-query.
    If the calculation isn't very complicated, then you might find it simpler just to repeat the calculation. For example, I think this is what you want:
    WITH     got_complete     AS
         SELECT    patient_id
         ,        COUNT ( CASE WHEN status = 1 THEN 1 END )     AS complete
         ,       COUNT ( CASE WHEN status = 2 THEN 1 END )      AS incomplete
         FROM        pt_status
         WHERE        status IN (1,2)
         GROUP BY  patient_id
    SELECT       patient_id, complete, incomplete
    ,                                complete / (complete + incomplete)     AS Ratio
    ,       RANK () OVER ( ORDER BY  complete / (complete + incomplete) ) - 1
                                                        AS decile
    FROM      got_complete
    ORDER BY  complete
    ,            incomplete     DESC
    ;RANK numbers rows 1, 2, 3, ... If I understand your requirements, you want the numbering to start with 0 (meaning "there are 0 other patients with a lower ratio"), so that's why I subtracted 1.
    Depending how you want to handle ties, you may need to add some tie-breaker expressions to the analytic ORDER BY clause, and/or use ROW_NUMBER instead of RANK.
    Here, I used the calculation "complete / (complete + incomplete)" in the ratio column, then repeated it in the decile column.
    I you want, you can add another sub-query, called got_ratio, which would add the ratio column, but do nothing about the decile column. Then, in the main query, you could use RANK as shown above (or, as you suggested, a scalar sub-query referencing got_ratio) to get the number of other pateient_ids with lower ratios.
    On the other hand, you could do this whole job without any sub-queries, using AVG as I did earlier, and then repeating that same AVG expression in the ORDER BY clause for RANK. Aggregate functions are computed before analytic fucntions, so the analytic RANK can referenece the aggregate AVG.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data. Include examples of decile ties (2 or more patients with the same ratio).
    Explain, using specific examples, how you get those results from that data.

  • Selecting data from single table with different condition in single query

    Hi everybody...
    I have one table with col1, col2, col3, col4, col5... as columns.
    I want to select col1, col2, col3 with condition (x=y and a=b and c=d)
    I want to select col4, col5 with condition (x=y and a=b and m=n )
    in single query...
    Thanx for ur help

    Given this data set...
    SQL> select * from oddity
      2  /
          COL1       COL2       COL3       COL4       COL5 A X C M
             1          2          3          4          5 B Y   M
             1          2          3          4          5 A Y C N
             1          2          3          4          5 A Y D M
             1          2          3          4          5 A Y D N
             1          2          3          4          5 B Y D N
             1          2          3          4          5 B Y D U
    6 rows selected.
    SQL>The following query meets the requirements. Of course, the requirements as stated are incomplete. I ahave assumed that we select all five columns if C=D andM=N.
    SQL> SELECT decode(c, 'D', col1, '0') AS col1
      2         , decode(c, 'D', col2, '0') AS col2
      3         , decode(c, 'D', col3, '0') AS col3
      4          , decode(m, 'N', col4, '-8') AS col4
      5           , decode(m, 'N', col5, '-8') AS col5
      6  FROM oddity
      7  WHERE a = 'B'
      8  AND  x = 'Y'
      9  /
          COL1       COL2       COL3       COL4       COL5
             0          0          0         -8         -8
             1          2          3          4          5
             1          2          3         -8         -8
    SQL> Cheers, APC

  • How can I update the table with a single query for...

    I have a table with columns C1 and C2.
    C1 C2
    A1 null
    A1 null
    A1 null
    A1 null
    A2 null
    A2 null
    A2 null
    A3 null
    A4 null
    A4 null
    I want to update my table with a single query so that I would have data like
    C1 C2
    A1 1
    A1 2
    A1 3
    A1 4
    A2 1
    A2 2
    A2 3
    A3 1
    A4 1
    A4 2
    The updated column C2 has the values like serial no grouped on the column C1.

    SQL> create table mytable
      2  ( c1 varchar2(2)
      3  , c2 number(2)
      4  )
      5  /
    Tabel is aangemaakt.
    SQL> insert into mytable (c1)
      2  select 'A1' from dual union all
      3  select 'A1' from dual union all
      4  select 'A1' from dual union all
      5  select 'A1' from dual union all
      6  select 'A2' from dual union all
      7  select 'A2' from dual union all
      8  select 'A2' from dual union all
      9  select 'A3' from dual union all
    10  select 'A4' from dual union all
    11  select 'A4' from dual
    12  /
    10 rijen zijn aangemaakt.
    SQL> select * from mytable
      2  /
    C1                                     C2
    A1
    A1
    A1
    A1
    A2
    A2
    A2
    A3
    A4
    A4
    10 rijen zijn geselecteerd.
    SQL> merge into mytable t1
      2  using (select c1
      3              , row_number() over (partition by c1 order by null) rn
      4              , rowid rid
      5           from mytable
      6        ) t2
      7     on (t1.rowid = t2.rid)
      8   when matched then
      9        update set c2 = rn
    10   when not matched then
    11        insert values (null,null)
    12  /
    10 rijen zijn samengevoegd.
    SQL> select * from mytable
      2  /
    C1                                     C2
    A1                                      1
    A1                                      2
    A1                                      3
    A1                                      4
    A2                                      1
    A2                                      2
    A2                                      3
    A3                                      1
    A4                                      1
    A4                                      2
    10 rijen zijn geselecteerd.Regards,
    Rob.

  • Getting Counts with single query

    HI,
    I need help in writing a query that gets account counts in a single query,
    CREATE TABLE ACCOUNTINFO(     
    ACCOUNTID VARCHAR2(20 BYTE) NOT NULL,
    ACCOUNTNO VARCHAR2(10 BYTE) NOT NULL,
    LAST_DEPOSIT_DATE DATE,
    BALANCE NUMBER(10,0));
    I have a table like above and I am trying to write a query that gets
    Count of accounts with deposits made in last 1 month,
    Count of accounts with deposits made in last 2 months
    Account Count with balance > 0,
    Also, I need to join this ACCOUNTINFO with ACCOUNTMAIN to get name etc details
    CREATE TABLE ACCOUNTINFO(     
    EMPID VARCHAR2(20 BYTE) NOT NULL,
    FNAME VARCHAR2(30 BYTE) NOT NULL,
    MNAME VARCHAR2(30 BYTE),
    LNAME VARCHAR2(30 BYTE) NOT NULL,
    DOB DATE,
    ACCOUNTID VARCHAR2(20 BYTE));
    Question, how to write a query since I getting too-many counts (I have only 3 in sample above, actual goes on like 3-6, 6-9 etc).

    SELECT SUM  (CASE WHEN LAST_DEPOSIT>=ADD_MONTHS(SYSDATE,-1) THEN
                   1
                 ELSE
                   0
                 END
                ) COUNT_LAST_MONTH,
           SUM  (CASE WHEN LAST_DEPOSIT>=ADD_MONTHS(SYSDATE,-2) THEN
                   1
                 ELSE
                   0
                 END
                ) COUNT_LAST_TWO_MONTHS,
           SUM  (CASE WHEN BALANCE>0 THEN
                   1
                 ELSE
                   0
                 END
                ) COUNT_BALANCE_GREATER_ZERO
      FROM ACCOUNTINFO

  • Update several rows with single query (easy question, I guess)

    Hi all!
    I have table with two columns - name and value.
    I populate it with several sql queries:
    insert into settings (name, value) values ('company_name', 'My Company');
    insert into settings (name, value) values ('company_address', 'Company Address 12');
    insert into settings (name, value) values ('company_city', 'South Park');
    How can update rows with company_name and company_city in single query?
    Thank you in advance!

    How can update rows with company_name and company_city in single query?I guess something like this was meant:
    update settings set value = ??? where name in ('company_name ', 'company_city');But it's still unclear to me what should be used instead of question marks... :)
    Regards.

  • Getting result with single query

    Hi,
    I'm using db 10.2.0.1.0
    I have a table emp_shift , with data like below
    EmpCode           Shift     Effdate            Default
    1                 SHFT1    02-jan-2012          N
    1                 SHFT2    04-jan-2012          Y
    1                 SHFT3    04-jan-2012          NSo if user inputs EmpCode and Effdate, based on that i've to take the latest record, with default = 'Y' (if any) else default 'N'
    Suppose
    Case 1 : Input Empcode:1 Date:10-jan-2012
    Then i should get the below record
    1                 SHFT2    04-jan-2012          YCase 2 : Input Empcode:1 Date:03-jan-2012
    Then i should get the below record
    1                 SHFT1    02-jan-2012          NI want this result with a single query, is this possible?
    Thanks
    Divya

    Hi Thank you both,
    I'm trying this process through forms. and my forms version is 6i.
    There where i'm trying the query with the cursor, i'm getting error
    Encountered the symbol Order when expecting one of the following
    .()...and my cursor is
    Cursor cur_shft(vemp Varchar2,vdate Varchar2) is Select ESM_SHIFT_TYPE
         from (Select ESM_SHIFT_TYPE from EMPLOYEE_SHIFT_MASTER
                   Where ESM_EMP_CODE = vemp
                   and ESM_EFF_DATE <= vdate
                   Order by ESM_EFF_DATE desc,Esm_Default desc)
                   Where rownum=1 ;Whats wrong?

  • Single Query with multiple fiscal variants / fiscal period

    Experts,
    Currently we have two different queries 1) for US and 2) for Mexico.
    Both the queries are hard-coded with respective company codes and different fiscal variants. We have i step =1 variable, so in both query we have respective fiscal period by default in variable screen.  The user can decide to run the query for current fiscal period or manually overwrite it for past few fiscal periods.
    Now, we want to consolidate two queries into a single one and behind the scene depending on company code entered by user we want the query to run for default period AND we also want user to have liberty to change it for different fiscal periods (similar to istep 1 variable) which is hard coded for each query. Please advice how to proceed?
    Thanks!

    Hi Durgesh,
    I agree with part 1- we can let user select his company code, but my challenge is pre-populate or get the default fiscal period for different company codes.
    2) You can keep rest of the things as it is, because you will be populating the default period value and if user want he can select the required value manually.
    (Alok) =  So if user runs report in Nov'2011 = the US fiscal period is 002/2012; but for Mexico it might be 011/2011 - so is there any way where we can give this value in prompt screen and at the same time not let user remember these values...
    Since with single query and without hardcoding how to determine the current fiscal period for different company codes?

  • Insert into two tables with a single query (same ID)

    Hello,
    I want to insert two tables at the same time ( with a single query) provided that both records get inserted with the same id. How do I do this?
    Table Movies
    id
    name
    Table Category
    movie_id
    cat_typea) Insert into first table, retrieve the id (may be by using my_sequence.currval and then insert into another table.
    issue: Makes three query to the db, I am also guessing that when multiple people try to insert there will be an issue, I might be wrong.
    I don't have any other idea.
    Greatly appreciated!

    Why don't use multitable insert ? It's available from 9i.
    A sequence.nextval will return the same value within the whole instruction
    so all records can be inserted with the same id.
    Look at this example:
    DROP TABLE A;
    DROP TABLE B;
    drop sequence a_seq;
    CREATE TABLE A(
      ID NUMBER,
      FIRSTNAME VARCHAR2(50)
    CREATE TABLE B AS
    SELECT id, firstname lastname FROM a;
    CREATE SEQUENCE a_seq
    START WITH 1;
    INSERT ALL
    INTO A(ID, FIRSTNAME) VALUES(A_SEQ.NEXTVAL, FNAME)
    INTO B(ID, LASTNAME) VALUES(A_SEQ.NEXTVAL, LNAME)
    SELECT 'fname ' || LEVEL FNAME, 'lname ' || LEVEL LNAME
    FROM DUAL
    CONNECT BY LEVEL < 10
    COMMIT;
    SELECT * FROM A;
    SELECT * FROM b;
    DROP TABLE A succeeded.
    DROP TABLE B succeeded.
    drop sequence a_seq succeeded.
    CREATE TABLE succeeded.
    CREATE TABLE succeeded.
    CREATE SEQUENCE succeeded.
    18 rows inserted
    commited
    ID                     FIRSTNAME                                         
    3                      fname 1                                           
    4                      fname 2                                           
    5                      fname 3                                           
    6                      fname 4                                           
    7                      fname 5                                           
    8                      fname 6                                           
    9                      fname 7                                           
    10                     fname 8                                           
    11                     fname 9                                           
    9 rows selected
    ID                     LASTNAME                                          
    3                      lname 1                                           
    4                      lname 2                                           
    5                      lname 3                                           
    6                      lname 4                                           
    7                      lname 5                                           
    8                      lname 6                                           
    9                      lname 7                                           
    10                     lname 8                                           
    11                     lname 9                                           
    9 rows selected

  • How to get this with Single query

    Friends
    I am sure using SQL analytical function, the following can be achieved using a single query:
    Date_value | Cust_id | Customer_tenue | avg_bal
    01-aug-09 | 111 | 0 | 1000
    01-aug-09 | 112 | 1 | 2000
    01-aug-09 | 113 | 2 | 900
    01-aug-09 | 114 | 3 | 1250
    01-sep-09 | 111 | 1 | 1200
    01-sep-09 | 112 | 2 | 2000
    01-sep-09 | 113 | 3 | 1900
    01-sep-09 | 114 | 4 | 1250
    01-oct-09 | 111 | 2 | 1100
    01-oct-09 | 112 | 3 | 2200
    01-oct-09 | 113 | 4 | 1900Expected result
    If customer’s tenure is 0 then mark as ‘New’,
    If customer’s balance is increased from last month then mark as ‘Augment’
    If customer’s balance is same as last month then mark as ‘Maintain’
    If customer’s balance is decreased from last month then mark as ‘Diminish’
    Else ‘Left’
    Help please....

    If customer’s tenure in last month is 0 then mark as ‘New’,There's not such case in test data... last month is October, isn't it?
    SQL> with t as (select DATE '2009-08-01' Date_value, 111 Cust_id, 0 Customer_tenue, 1000 avg_bal from dual union all
      2  select DATE '2009-08-01', 112 , 1 , 2000 from dual union all
      3  select DATE '2009-08-01', 113 , 2 , 900 from dual union all
      4  select DATE '2009-08-01', 114 , 3 , 1250 from dual union all
      5  select DATE '2009-09-01', 111 , 1 , 1200 from dual union all
      6  select DATE '2009-09-01', 112 , 2 , 2000 from dual union all
      7  select DATE '2009-09-01', 113 , 3 , 1900 from dual union all
      8  select DATE '2009-09-01', 114 , 4 , 1250 from dual union all
      9  select DATE '2009-10-01', 111 , 2 , 1100 from dual union all
    10  select DATE '2009-10-01', 112 , 3 , 2200 from dual union all
    11  select DATE '2009-10-01', 113 , 4 , 1900 from dual)
    12  select date_value, cust_id, avg_bal, oldbal, case when Customer_tenue=0 and nextbal is null then 'NEW'
    13                                                    when oldbal<avg_bal then 'Augment'
    14                                                    when oldbal=avg_bal then 'Maintain'
    15                                                    when oldbal>avg_bal then 'Diminish'
    16                                                    else 'Left' end status
    17    from (select date_value, cust_id, customer_tenue, avg_bal, LEAD(avg_bal) over (partition by cust_id order by date_value desc) oldbal,
    18                 LAG(avg_bal) over (partition by cust_id order by date_value desc) nextbal
    19            from t)
    20  order by cust_id, date_value;
    DATE_VALU    CUST_ID    AVG_BAL     OLDBAL STATUS
    01-AGO-09        111       1000            Left
    01-SET-09        111       1200       1000 Augment
    01-OTT-09        111       1100       1200 Diminish
    01-AGO-09        112       2000            Left
    01-SET-09        112       2000       2000 Maintain
    01-OTT-09        112       2200       2000 Augment
    01-AGO-09        113        900            Left
    01-SET-09        113       1900        900 Augment
    01-OTT-09        113       1900       1900 Maintain
    01-AGO-09        114       1250            Left
    01-SET-09        114       1250       1250 Maintain
    Selezionate 11 righe.Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/29/estrarre-i-dati-in-formato-xml-da-sql/]

  • How to use multiple hierarchies for a single char in single query

    Hi,
    Is there any way that we can use multiple hierarchies for a single char in single query. I tried and it just allows me to select one hierarchy even if I use hierarchy variable.
    I have a requirement where user wants to see information related to a cost center with different cost center groups in different hierarchies (every year has different cost center group hierarchies).
    Suppose I want to see information related to a cost center from year 2001-2004.in these four year cost center may have been associated to different groups depending upon that year hierarchy. How can I do that?
    Thanks
    Jona

    Nope. Now way to do this.
    There is always just one hierarchy assigned to a characteristic. And even if the hierarchy was time dependent, it only reads it for one key date and not according to transaction data.
    Regards,
    Beat

Maybe you are looking for

  • Photo Editor not opening

    I purchased Photoshop Elements 12 last week from amazon.com and I haven't been able to get the Photo Editor to open. My laptop is not connected to any printers and it's not a Mac. How can I open it? When I try to open the Organizer it says "Online Se

  • Solaris 10 x86 jumpstart patch problem

    I'm trying to jumpstart and deploy the patch using the profile file(classfile). I does work well on the sparc however I seem to have an issue with x86. The line in profile file looks like this patch patch_order nfs server1:/patch/10_x86 patch patch_o

  • AppleVision CRT stuck in resolution limbo

    I'm not sure where best to post this but will start here... A few months ago I brought home an old AppleVision 17" CRT from the office graveyard and started using it with my G5, because its viewable area was a little bigger than that of my NEC MultiS

  • Driver development on solaris 8

    Hello, I want to know which all the documents I need to refer for developing a network interface driver (token ring ) on solaris 8. Where can I find all these documents. Thank you Purushottam

  • Ichat cam is broke...quicktime cam works...same internal camera!! help!

    My internal isight camera just stopped working with ichat. i fired up quicktime recording, and it's working fine. nothing is out of order in system profiler...but ichat still won't work. photobooth just shows black as well....same as ichat. any sugge