Order table data with comparing rows

Hi,
My question is...
I have table with with 5 columns this actually is been loaded from a file and there is no direct PK, but for that combination of columns as used to make them unique
code, person, case
Table X
CODE             CASE              OLD_ID                NEW_ID            PERSON       AUTH
01              ab122         1234               0001             AU123     99393
07              vv353          7872               0919             FV982     78282
01              ab122         1982               9929             AU123     99393
04               hjsss         8839                8302            JK920     32320
01              ab122         0001               1982             AU123     99393
05              cg899         6728               32322           IKL020     65252
07              w353          0919                8282             FV982     78282
now I need to order this data comparing row values of old_id to new_id for each of the combinations of code, person, case
need output like below
Table X
CODE             CASE              OLD_ID                NEW_ID            PERSON       AUTH
01              ab122         1234               0001             AU123     99393
01              ab122         0001               1982             AU123     99393
01              ab122         1982               9929             AU123     99393
04               hjsss         8839                8302            JK920     32320
05              cg899         6728              32322           IKL020     65252
07              vv353          7872               0919             FV982     78282
07              w353          0919                8282            FV982     78282
hot to get this result, any help is much appreciated..
Thanks,
AK.

Yes you are right, I took it down to edit this in that time you have posted the message...
Question:
Table data need to be sorted by matching old_id with new_id
actual table : here rows are randomly arranged
Table X
CODE             CASE              OLD_ID                NEW_ID            PERSON       AUTH
01              ab122         1234               0001             AU123     99393
07              vv353          7872               0919             FV982     78282
01              ab122         1982               9929             AU123     99393
04               hjsss         8839                8302            JK920     32320
01              ab122         0001               1982             AU123     99393
05              cg899         6728               32322           IKL020     65252
07              w353          0919                8282             FV982     78282
output table: here if you see old_id of row 2 is matched to new_id of row 1.. and so on
Table X
CODE             CASE              OLD_ID                NEW_ID            PERSON       AUTH
01              ab122         1234               0001             AU123     99393
01              ab122         0001               1982             AU123     99393
01              ab122         1982               9929             AU123     99393
04               hjsss         8839                8302            JK920     32320
05              cg899         6728              32322           IKL020     65252
07              vv353          7872               0919             FV982     78282
07              w353          0919                8282            FV982     78282
so, I need a query where I can generate this output..

Similar Messages

  • How to export table data with coloring of cell according to value.

    Hi all,
    I am using jdeveloper 11.1.1.6
    i want to export table data with lot of formatting. like with coloring of cell according to value and so many.How to do that?

    Hi,
    like with coloring of cell according to value and so many.How to do that?
    Answer is, you can't
    Frank

  • How join a type table data with a real table.

    Hello,
    I want make a join with a type table data and real table.
    But i don't know how make this.
    Can you help me?????
    I have this pl/sql:
    SET LINESIZE 5000;
    DECLARE
    valor NUMBER;
    TYPE reg_tablita IS RECORD
    (cuenta B_TB_CTAFACTU.B_CO_CTAFACTU%TYPE,sistema B_TB_CTAFACTU.B_CO_SISTEMA%TYPE);
    TYPE Tabla IS TABLE OF reg_tablita INDEX BY BINARY_INTEGER;
    I                         BINARY_INTEGER;
    Array Tabla;
    BEGIN
    Array(1).cuenta:='000001';
    Array(1).sistema:='AA';
    Array(2).cuenta:='000002';
    Array(2).sistema:='BB';
    Array(3).cuenta:='000003';
    Array(3).sistema:='CC';
    Array(4).cuenta:='000004';
    Array(4).sistema:='DD';
    Array(5).cuenta:='000005';
    Array(5).sistema:='EE';
    SELECT count(*) into valor FROM
    TABLA A, Array WHERE
    B_CO_CTAFACTU=Array.cuenta and B_CO_SISTEMA=Array.sistema
    quit;
    Thanks very much!!!!

    You need to have the types defined as SQL types (created in database) in order to be able to use them for joining. PL/SQL object types can not be joined.

  • Fetch Multiple row in repor to insert data with multiple rows .

    Hi Friends
    i want to Insert emp attendance .
    There are 10 emp in company .they enter there arival time in attendance register .
    i have two item
    1--p1_att_date
    2--p1_status
    ATTEN_STATUS are PRESENT by default in selectlist .
    i want, when i enter date in p1_att_date item and Press submit then generate a report with 10 employee and insert in_time in report and when press enter then data with 10 emp should insert in to table ABC .
    i don't want to use tabularform for this .actully i don't want to use ADD_ROW option to ADD attendance for second emp.so please give me some solution.
    Emp_ID     ATTEN_DATE     ATTEN_STATUS      IN_TIME     OUT_TIME
    101     22-JAN-2009     PRESENT          
    102     22-JAN-2009     PRESENT          
    103     22-JAN-2009     PRESENT          
    104     22-JAN-2009     PRESENT          
    105     22-JAN-2009     PRESENT          
    106     22-JAN-2009     PRESENT          
    107     22-JAN-2009     PRESENT          
    108     22-JAN-2009     PRESENT          
    109     22-JAN-2009     PRESENT          
    110     22-JAN-2009     PRESENT     
    My table is :-
    table Name --ABC
    emp_id number;
    atten_date date;
    atten_status varchar2(12);
    in_time timestemp;
    out_time timestemp;
    How can i do this.
    Thanks
    Manoj

    Hi Manoj,
    You can create multiple records easily using a single, simple, form. However, you would surely have to enter in the times individually using a tabular form (otherwise, you would have to use the same form 10 times). You do not have to keep the Add Row option on the page - this functionality can be removed.
    Andy

  • How to restrict table data at a row level?

    Hi everybody,
    I need create a database user and restrict his data access to certain tables.
    What is the best way to do this?
    Eg Table Emp has two columns, sal and dept. Sal has three distinct values: 500, 1000, 1500.
    I need to make it so that new_user can only see the data in table emp where the sal value = 500.
    Many thanks
    Rup

    You can use row-level security (VPD) for this sort of thing, so you assign a policy to the table that restricts which rows a particular user can see.
    You can also roll your own solution by creating a view on the table and granting the user access to that view rather than direct access to the table.
    Justin

  • Export and import table data with Java

    I need a library for simple exporting and importing table data.
    The data should be exported to a SQL file with insert statements.
    I just want to tell the library the table name, the connection and where to store the file. The usage should be very simple.
    Are there any small libraries for this? Finished calsses and methods which I can just call?

    I need a library for simple exporting and importing
    table data.
    The data should be exported to a SQL file with insert
    statements.Every database has utilities to export/import data from tables. Take a look at your database manual.

  • Control Sales order Pricing Date with Delivery GI Date

    Is it possible to have a control that ensures the Actual GI date in a delivery is not more than a number of days from the sales order pricing date?

    Hi,
    To have restriction in actual GI date in transaction VL01N . Please find the user exit for VL01N , you can use one which are marked as bold . Kindly take the help of abaper to put the validation or logic as required.
    V02V0001   - Sales area determination for stock transport order 
    V02V0002   - User exit for storage location determination 
    V02V0003   - User exit for gate + matl staging area determination 
    V02V0004   - User Exit for Staging Area Determination (Item) 
    V50PSTAT  - Delivery: Item Status Calculation 
    V50Q0001   - Delivery Monitor: User Exits for Filling Display Fields
    V50R0001    -  Collective processing for delivery creation 
    V50R0002    - Collective processing for delivery creation 
    V50R0004    - Calculation of Stock for POs for Shipping Due Date List
    V50S0001    - User Exits for Delivery Processing 
    V53C0001    - Rough workload calculation in time per item 
    V53C0002    - W&S: RWE enhancement - shipping material type/time slot
    V53W0001   - User exits for creating picking waves 
    VMDE0001  - Shipping Interface: Error Handling - Inbound IDoc 
    VMDE0002  - Shipping Interface: Message PICKSD (Picking, Outbound) 
    VMDE0003  - Shipping Interface: Message SDPICK (Picking, Inbound) 
    VMDE0004  - Shipping Interface: Message SDPACK (Packing, Inbound) 
    Hope this will help you to resolve your issue!!!!
    Regards,
    Krishna O

  • Compare table data with data in csv file

    Hi, I have a database table with ~32 milj rows. I want to compare the data from a csv file(~ 1500000 rows) with the data in a specific database column. And as a result I want to see what rows exists in both the csv file and db and what records in csv file are unique. The text I'm searching for is VARCHAR2. I am not allowed to export the database table so that's not an alternative. This is also a production environment so one need to be careful not disturbing the production.
    Rgds J

    2c0eaa24-46c9-4ff7-9f01-564f37567899 wrote:
    Hi, I have a database table with ~32 milj rows. I want to compare the data from a csv file(~ 1500000 rows) with the data in a specific database column. And as a result I want to see what rows exists in both the csv file and db and what records in csv file are unique. The text I'm searching for is VARCHAR2. I am not allowed to export the database table so that's not an alternative. This is also a production environment so one need to be careful not disturbing the production.
    Rgds J
    How do I ask a question on the forums?
    https://forums.oracle.com/message/9362002#9362002
    Does CVS fille reside on DB Server system now?

  • Data with two rows in a single column

    I have been working on a report with the customer due amounts shown in bucketed columns eg 1-30 , 31-60 etc for each Customer,
    so for each column I want to show an additional row with the % of the due amounts for each bucketed column.
    . The format of report should look like below in pivot/table view
    |Customer| |Due1-30 | Due31-60 | Due60+ |     Total |
    |XYZ | |     3000 |     2000 |     5000 |     10000 |
    |      |%Due |     30% |     20% | 50% |     100% |
    ABC….                         
    I have to get the percentages on the measure values in a separate row(not as a seperate column). Could you please help me how to get result like the format what I have shown
    Thanks,
    BP
    Edited by: user8116383 on May 6, 2011 8:55 AM

    Hi
    This can be achievable by using Pivot view.
    1.In Columns field place the customer and place the measure lables in the rows field and the measure column in measure field.
    2.Duplicate the measure column and name it as %Due and click more options on this duplicated column and click shown data as -> percent of -> Row
    Thanks
    Diney

  • Problem getting the Table Data with the selection listener

    Hi All,
    I am working on a tree and table components. I wrote a logic in the backing bean in such a way that when I expand a node the child nodes for the tree are getting added dynamically and also getting the data in the table for the node expanded in the tree using the same Toplink Query . I added the selection listener for the table and when I am selecting a row in the table I am getting the Null Pointer Exception as the RowKeySet Value for the row selected is coming null.
    Can any one please help me out with this problem
    I will be very thankful
    Regards,
    Madhavi.

    Hi All,
    I am working on a tree and table components. I wrote a logic in the backing bean in such a way that when I expand a node the child nodes for the tree are getting added dynamically and also getting the data in the table for the node expanded in the tree using the same Toplink Query . I added the selection listener for the table and when I am selecting a row in the table I am getting the Null Pointer Exception as the RowKeySet Value for the row selected is coming null.
    Can any one please help me out with this problem
    I will be very thankful
    Regards,
    Madhavi.

  • Procedure to delete mutiple table records with 1000 rows at a time

    Hello Champs,
    I am having requirement to create procedure to achive the deletes from 5 big tables. 1 master table and 4 child tables. Each table has 28 millions records. Now I have to schedule a procedure to run it on daily basis to delete approximately 500k records from each tables. But the condition is: Seperate procedures for each tables and delete only 1000 rows at a time. The plan is below. Since I am new for writing complicate procedure, I don't have much idea how to code the procedures, can some one help me to design the procedure queries. Many Thanks
    1. Fetch 1000 rows from master table with where clause condition.
    2. Match them with each child tables and delete the records.
    3. Atlast delete those 1000 rows from master table.
    4. over all commit for all 5 X 1000 records.
    5. Repeat the steps 1 to 4 till no rows to fetch from master table.
    Below are detailed procedure plan:----
    ----- Main procedure to fetch 1000 rows at a time and providing them as input to 5 different procedures to delete records, repeating same steps till no rows to fetch i.e. (i=0)-----
    Create procedure fetch_record_from_master_table:
    loop
    i = Select column1 from mastertable where <somecondition> and rowcount <= 1000;
    call procedure 1 and i rows as input;
    call procedure 2 and i rows as input;
    call procedure 3 and i rows as input;
    call procedure 4 and i rows as input;
    call procedure 5 and i rows as input;
    commit;
    exit when i=0
    end loop;
    ----- Sepereate procedure's to delete records from each child tables------
    Create procedure 1 with input:
    delete from child_table1 where column1=input rows of master table;
    Create procedure 2 with input:
    delete from child_table2 where column1=input rows of master table;
    Create procedure 3 with input:
    delete from child_table3 where column1=input rows of master table;
    Create procedure 4 with input:
    delete from child_table4 where column1=input rows of master table;
    --- procedure to delete records from master table atlast----
    Create procedure 5 with input:
    delete from Master_table where column1=input rows of master table;

    Oops, but this will work, won't it?
    begin
      execute immediate 'truncate table child_table1';
      execute immediate '  truncate table child_table2';
      execute immediate '  truncate table child_table3';
      execute immediate '  truncate table child_table4';
      for r_fk in ( select table_name, constraint_name
                    from user_constraints
                    where table_name = 'MASTER_TABLE'
                    and   constraint_type = 'R'
      loop
        execute immediate 'ALTER TABLE ' || r_fk.table_name || ' MODIFY CONSTRAINT ' || r_fk.constraint_name || ' DISABLE';
      end loop;
      execute immediate '  truncate table master_table';
      for r_fk in ( select table_name, constraint_name
                    from user_constraints
                    where table_name = 'MASTER_TABLE'
                    and   constraint_type = 'R'
      loop
        execute immediate 'ALTER TABLE ' || r_fk.table_name || ' MODIFY CONSTRAINT ' || r_fk.constraint_name || ' ENABLE';
      end loop;
    end;
    / Or
      truncate table child_table1;
      truncate table child_table2;
      truncate table child_table3;
      truncate table child_table4;
    begin
      for r_fk in ( select table_name, constraint_name
                    from user_constraints
                    where table_name = 'MASTER_TABLE'
                    and   constraint_type = 'R'
      loop
        execute immediate 'ALTER TABLE ' || r_fk.table_name || ' MODIFY CONSTRAINT ' || r_fk.constraint_name || ' DISABLE';
      end loop;
    end;
    truncate table master_table;
    begin
      for r_fk in ( select table_name, constraint_name
                    from user_constraints
                    where table_name = 'MASTER_TABLE'
                    and   constraint_type = 'R'
      loop
        execute immediate 'ALTER TABLE ' || r_fk.table_name || ' MODIFY CONSTRAINT ' || r_fk.constraint_name || ' ENABLE';
      end loop;
    end;
    /

  • Pages Link Table Data With A Chart

    Hello,
    I am wondering if in pages one can link the data in a table with the charts in the same document.
    Thanks in advance

    No. It might be better for you to work in Numbers if you are doing a lot of this.
    Jerry

  • How to incorporate table data with Oracle Business Rule

    hello
    I want to use table with data in Oracle Business Rule can i do it.
    if yes please write how .
    with regs
    saleem

    Hi,
    like with coloring of cell according to value and so many.How to do that?
    Answer is, you can't
    Frank

  • Replace Table Data With Search

    I want to run a search but only on a selected 8 cells, and want to change all the words "Blue" to "Red", even I select those cells when I hit Search it seems to replace all of the cells... Any ideas anyone?

    Numbers won't do a find/replace limited to the selection.
    Two ways of accomplishing this:
    1. Don't use "Replace all". Instead,click "Find Next", then "Replace & Find"for each occurrence you want to change, and "Find next" on each that you wish to stay the same.
    2. To limit the changes to a single table, select each of the tables you do NOT wish to change and go Arrange > Lock. When all are locked, proceed with the Find/Replace, using Replace All. All occurrences on the unlocked table will be replaced. All data on the Locked table(s) will remain unchanged.
    Regards,
    Barry

  • Browsing table data with server explorer.

    I'm trying to browse data from a table in a different schema. When I double click on the table, I keep getting an error. Schema object MY_TABLE.MY_SCHEMA : Table @ JIN.dbprd/prd1 no longer exists in the database. I can see that (at least in the message), the table and schema is clearly reversed. Anybody else having this problem? is this a known issue? any fix?

    If you would like to try to diagnose this, please try the following:
    1) Close Visual Studio and all applications that are connected to Oracle
    2) In the same Oracle Home as the ODT install, please find the SQLNET.ORA file
    3) In that file, add a line:
    TRACE_LEVEL_CLIENT=16
    4) Start Visual Studio
    5) Reproduce the error as efficiently as possible (with no extra steps)
    6) Close Visual Studio immediately
    7) Search for the newly created SQLNET.TRC file
    8) Zip the file, rename the extension to .zipa or something else and email to [email protected]
    9) Remove the TRACE_LEVEL_CLIENT entry in SQLNET.ORA

Maybe you are looking for

  • Bluetooth in car system Audi A6

    Integral bluetooth car system for an Audi A6 is not compatable with a Nokia 6233.Other Nokia models connect ok. Is it possibe to amend the Nokia bluetooth software to make it compatable. Advice appreciated.

  • Can I install BOE XI r2 on a CE 10 Server (not upgrade)?

    Greetings! I have recently inherited responsibility of getting all our customers upgraded to BOE XI from CE 10. I am finding that if you attempt to install BOE XI R2 on the server that currently has CE 10, you have no choice but to upgrade. Upgrading

  • Enable USER to choose output type

    Hi all, General question. Is it possible to have a single report have an output in several types (.txt,.pdf,...) depending on the user's wishes? If so, outlining the steps to do this would prove very helpful. Right now we have things like Report1 --

  • Import multiple songs

    hi, i just got a new computer and i have all of my music on an external hard drive. i was wondering if there was a way to select all the songs in a file to import instead of one by one which will take forever. one by one is all i could figure out. pl

  • How to parse binary files

    Hi All, I have one binary file (abc.dat) file I want to parse that file and need it in text format. Can anyone tell me how can I achieve that? is there any third party tools available? lines are like below: 00000000h: 76 04 00 01 00 FF 0F 11 FF 09 07