PL SQL Grouping and Edit the Oldest Row in a Group

Event Table
CREATE TABLE "EVENT" ("EVENT_ID" VARCHAR2(36), "EVENTTYPE" VARCHAR2(110), "WHEN_OCCURRED" TIMESTAMP (6),"DESCRIPTION" VARCHAR2(255), "CURRENCY" VARCHAR2(3), "AMOUNT" NUMBER(38,8), "TRANSACTION_ID" VARCHAR2(255) )
Insert into EVENT (EVENT_ID,EVENTTYPE,DESCRIPTION,CURRENCY,AMOUNT,TRANSACTION_ID) values ('1','paymentEvent',to_timestamp('15-AUG-11 10.11.30.165000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'Payment Transaction Confirmed','USD',10','3');
Insert into EVENT (EVENT_ID,EVENTTYPE,DESCRIPTION,CURRENCY,AMOUNT,TRANSACTION_ID) values ('2','paymentEvent',to_timestamp('15-AUG-11 12.31.23.162000000 PM','DD-MON-RR HH.MI.SS.FF AM'),'Payment Transaction Confirmed','USD',10,'3085c51d-6425-4974-b2fb-f5bdc4d08137');
Transaction table
CREATE TABLE "TRANSACTION" ("TRANSACTION_ID" VARCHAR2(36 BYTE), "LAST_UPDATED" TIMESTAMP (6), "DESCRIPTION" VARCHAR2(255 BYTE), "TYPE" VARCHAR2(255 BYTE), "DEBIT_CREDIT" NUMBER(38,8), "ORIGINAL_ID" VARCHAR2(36 BYTE), "TYPE" VARCHAR2(255 BYTE))
Insert into TRANSACTION (TRANSACTION_ID,LAST_UPDATED,DESCRIPTION,TYPE,DEBIT_CREDIT,ORIGINAL_ID,EVENT_ID) values ('c8ef1e7c-4134-45d8-9568-5da2fc41e137',to_timestamp('15-AUG-11 12.01.42.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),'Correction: Payment Transaction Confirmed','SETTLEMENT',1,'3','1', 'debit');
Insert into TRANSACTION (TRANSACTION_ID,LAST_UPDATED,DESCRIPTION,TYPE,DEBIT_CREDIT,ORIGINAL_ID,EVENT_ID) values ('8243cc1d-614d-4cfd-9c3b-b5cd44b3a67f',to_timestamp('15-AUG-11 12.29.45.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),'Correction: Payment Transaction Confirmed','SETTLEMENT',1,'3','1', 'credit');
Insert into TRANSACTION (TRANSACTION_ID,LAST_UPDATED,DESCRIPTION,TYPE,DEBIT_CREDIT,ORIGINAL_ID,EVENT_ID) values ('3',to_timestamp('15-AUG-11 10.11.30.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'testCharge','PAYMENT',10,null,null,null);
Insert into TRANSACTION (TRANSACTION_ID,LAST_UPDATED,DESCRIPTION,TYPE,DEBIT_CREDIT,ORIGINAL_ID,EVENT_ID) values ('609f264b-1cef-4615-8f28-d8dae391dbba',to_timestamp('15-AUG-11 10.17.43.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'Correction: Payment Transaction Confirmed','SETTLEMENT',4,'3','1', 'debit');
Insert into TRANSACTION (TRANSACTION_ID,LAST_UPDATED,DESCRIPTION,TYPE,DEBIT_CREDIT,ORIGINAL_ID,EVENT_ID) values ('3085c51d-6425-4974-b2fb-f5bdc4d08137',to_timestamp('15-AUG-11 12.31.23.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),'testCharge','PAYMENT',10,null,null,null);
Insert into TRANSACTION (TRANSACTION_ID,LAST_UPDATED,DESCRIPTION,TYPE,DEBIT_CREDIT,ORIGINAL_ID,EVENT_ID) values ('bafc4f83-d3b7-45f2-b35d-ba4101eebf3c',to_timestamp('15-AUG-11 12.31.44.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),Settle: Payment Transaction Confirmed','SETTLEMENT',2,'3085c51d-6425-4974-b2fb-f5bdc4d08137','2','debit');
Insert into TRANSACTION (TRANSACTION_ID,LAST_UPDATED,DESCRIPTION,TYPE,DEBIT_CREDIT,ORIGINAL_ID,EVENT_ID) values ('bbb6123b-8b70-45f2-b593-5b6bb2afd6b2',to_timestamp('15-AUG-11 10.18.56.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'Correction: Payment Transaction Confirmed','SETTLEMENT',2,'3','1','credit');
Result
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,TRX_DESC,GROSS,NET) values ('609f264b-1cef-4615-8f28-d8dae391dbba',to_timestamp('15-AUG-11 10.17.43.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),0,4,'3','Payment Transaction Confirmed',10,6);
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,TRX_DESC,GROSS,NET) values ('bbb6123b-8b70-45f2-b593-5b6bb2afd6b2',to_timestamp('15-AUG-11 10.18.56.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),2,0,'3','Correction: Payment Transaction Confirmed',0,2);
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,TRX_DESC,GROSS,NET) values ('c8ef1e7c-4134-45d8-9568-5da2fc41e137',to_timestamp('15-AUG-11 12.01.42.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),0,1,'3','Correction: Payment Transaction Confirmed'0,-1);
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,TRX_DESC,GROSS,NET) values ('8243cc1d-614d-4cfd-9c3b-b5cd44b3a67f',to_timestamp('15-AUG-11 12.29.45.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),1,0,'3','Correction: Payment Transaction Confirmed'0,1);
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,TRX_DESC,GROSS,NET) values ('bafc4f83-d3b7-45f2-b35d-ba4101eebf3c',to_timestamp('15-AUG-11 12.31.44.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),0,2,'3085c51d-6425-4974-b2fb-f5bdc4d08137','Payment Transaction Confirmed'10,8);
Explanation
* Each event table insert has a respective type='payment' insert in transaction table.
* My result interesting only about transaction type='settlement'
* One type = 'payment' transaction could have one type = 'settlement' by default. But in a some cases (an error) there be many type = settlement
* When we take transaction_id = '3' it has 4 'settlement' transactions
To the result these four(4) settlement takes and out of a four the oldest transaction should have a different presentation
(See result number 01)
If payment transaction has only one settlement transaction then the result description = Payment Transaction Confirmed
gross = respective event table amount
net = gross + credit - debit
if payment transaction has more than one settlement transaction then * Oldest transaction ( order by LAST_UPDATED)
description = Payment Transaction Confirmed
gross = respective event table amount
net = gross + credit - debit
* All other transactions
description = Correction: Payment Transaction Confirmed
gross = 0
net = if type = debit then net = -(debit) else credit
Appreciate your help for write a PL/SQL query that satisfies above.
I am thinking to
Group all relative settlement transactions into one unit.
Find oldest among them
Apply different logic for oldest
Apply common logic for othersStill need some help from you guys to convert my thoughts into SQL
Thanks

Yes. that is what I initially trying to do. But no success.
Please refer below my effort
Transaction table
CREATE TABLE "TRANSACTION" ("TRANSACTION_ID" VARCHAR2(36 BYTE), "OBJECT_TYPE" VARCHAR2(255 BYTE), "VERSION" NUMBER(19,0), "CREATED" TIMESTAMP (6), "LAST_UPDATED" TIMESTAMP (6), "DESCRIPTION" VARCHAR2(255 BYTE), "EXTERNAL_ID" VARCHAR2(255 BYTE), "TYPE" VARCHAR2(255 BYTE), "STATE" VARCHAR2(255 BYTE), "LAST_STATE_CHANGE" TIMESTAMP (6), "CHANNEL" VARCHAR2(255 BYTE), "MANDATE_ID" VARCHAR2(255 BYTE), "SUBSCRIPTION_ID" VARCHAR2(255 BYTE), "BULK_REFUND_TASK_ID" VARCHAR2(255 BYTE), "GROSS_CURRENCY" VARCHAR2(3 BYTE), "GROSS_AMOUNT" NUMBER(38,8), "TAX_CURRENCY" VARCHAR2(3 BYTE), "TAX_AMOUNT" NUMBER(38,8), "PAYER_ID" VARCHAR2(36 BYTE), "PAYEE_ID" VARCHAR2(36 BYTE), "ON_BEHALF_OF_PAYEE" VARCHAR2(255 BYTE), "ORIGINAL_ID" VARCHAR2(36 BYTE), "TRANSFER_ID" VARCHAR2(36 BYTE), "EVENT_ID" VARCHAR2(36 BYTE), "TERM_ID" VARCHAR2(36 BYTE), "CHARGE" NUMBER(1,0) DEFAULT 0, "TAGS_AND_VALUES" VARCHAR2(4000 BYTE), "LARGE_TAGS_AND_VALUES" CLOB, "EXPORT_PENDING" VARCHAR2(4 BYTE) DEFAULT 'TRUE')
Data
Insert into TRANSACTION (TRANSACTION_ID,OBJECT_TYPE,VERSION,CREATED,LAST_UPDATED,DESCRIPTION,EXTERNAL_ID,TYPE,STATE,LAST_STATE_CHANGE,CHANNEL,MANDATE_ID,SUBSCRIPTION_ID,BULK_REFUND_TASK_ID,GROSS_CURRENCY,GROSS_AMOUNT,TAX_CURRENCY,TAX_AMOUNT,PAYER_ID,PAYEE_ID,ON_BEHALF_OF_PAYEE,ORIGINAL_ID,TRANSFER_ID,EVENT_ID,TERM_ID,CHARGE,TAGS_AND_VALUES,EXPORT_PENDING) values ('c8ef1e7c-4134-45d8-9568-5da2fc41e137','com.valista.trxe.model.Transaction',1,to_timestamp('15-AUG-11 12.01.42.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('15-AUG-11 12.01.42.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),'Correction: Payment Transaction Confirmed',null,'SETTLEMENT','CONFIRMED',to_timestamp('15-AUG-11 12.01.42.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),null,null,null,null,'USD',1,'USD',0,'9f285bf7-46a1-4621-b165-dc782bf1d1ae','1c887a16-4344-4a80-8a11-f26d80824e4a',null,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14','f24be53d-7b78-455c-b1ac-f9fc242ec5ff','a2f09cbb-1555-4c8d-b401-0233982cfa7e','c6b70c01-7f9a-4d96-93a6-e8e1b568cf59',1,null,'TRUE');
Insert into TRANSACTION (TRANSACTION_ID,OBJECT_TYPE,VERSION,CREATED,LAST_UPDATED,DESCRIPTION,EXTERNAL_ID,TYPE,STATE,LAST_STATE_CHANGE,CHANNEL,MANDATE_ID,SUBSCRIPTION_ID,BULK_REFUND_TASK_ID,GROSS_CURRENCY,GROSS_AMOUNT,TAX_CURRENCY,TAX_AMOUNT,PAYER_ID,PAYEE_ID,ON_BEHALF_OF_PAYEE,ORIGINAL_ID,TRANSFER_ID,EVENT_ID,TERM_ID,CHARGE,TAGS_AND_VALUES,EXPORT_PENDING) values ('8243cc1d-614d-4cfd-9c3b-b5cd44b3a67f','com.valista.trxe.model.Transaction',1,to_timestamp('15-AUG-11 12.29.45.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('15-AUG-11 12.29.45.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),'Correction: Payment Transaction Confirmed',null,'SETTLEMENT','CONFIRMED',to_timestamp('15-AUG-11 12.29.45.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),null,null,null,null,'USD',1,'USD',0,'1c887a16-4344-4a80-8a11-f26d80824e4a','9f285bf7-46a1-4621-b165-dc782bf1d1ae',null,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14','ac5ae000-7ca8-4542-bf83-8d99e085e706','a2f09cbb-1555-4c8d-b401-0233982cfa7e','b70382c8-a05e-49c4-9919-ad765c5c5046',1,null,'TRUE');
Insert into TRANSACTION (TRANSACTION_ID,OBJECT_TYPE,VERSION,CREATED,LAST_UPDATED,DESCRIPTION,EXTERNAL_ID,TYPE,STATE,LAST_STATE_CHANGE,CHANNEL,MANDATE_ID,SUBSCRIPTION_ID,BULK_REFUND_TASK_ID,GROSS_CURRENCY,GROSS_AMOUNT,TAX_CURRENCY,TAX_AMOUNT,PAYER_ID,PAYEE_ID,ON_BEHALF_OF_PAYEE,ORIGINAL_ID,TRANSFER_ID,EVENT_ID,TERM_ID,CHARGE,TAGS_AND_VALUES,EXPORT_PENDING) values ('61db88ec-ade8-4cc3-90f3-e49fa26dcf14','com.valista.trxe.model.Transaction',5,to_timestamp('15-AUG-11 10.11.30.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('15-AUG-11 12.29.45.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),'testCharge',null,'PAYMENT','CONFIRMED',to_timestamp('15-AUG-11 10.11.30.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),null,null,null,null,'USD',10,'USD',0,'e8a58763-9faa-4632-a2b3-747aa00fe9c4','9f285bf7-46a1-4621-b165-dc782bf1d1ae',null,null,'ac45ebc4-f817-42e7-8d4a-96e41fb40ef8',null,null,1,null,'TRUE');
Insert into TRANSACTION (TRANSACTION_ID,OBJECT_TYPE,VERSION,CREATED,LAST_UPDATED,DESCRIPTION,EXTERNAL_ID,TYPE,STATE,LAST_STATE_CHANGE,CHANNEL,MANDATE_ID,SUBSCRIPTION_ID,BULK_REFUND_TASK_ID,GROSS_CURRENCY,GROSS_AMOUNT,TAX_CURRENCY,TAX_AMOUNT,PAYER_ID,PAYEE_ID,ON_BEHALF_OF_PAYEE,ORIGINAL_ID,TRANSFER_ID,EVENT_ID,TERM_ID,CHARGE,TAGS_AND_VALUES,EXPORT_PENDING) values ('609f264b-1cef-4615-8f28-d8dae391dbba','com.valista.trxe.model.Transaction',1,to_timestamp('15-AUG-11 10.17.43.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('15-AUG-11 10.17.43.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'Correction: Payment Transaction Confirmed',null,'SETTLEMENT','CONFIRMED',to_timestamp('15-AUG-11 10.17.43.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),null,null,null,null,'USD',4,'USD',0,'9f285bf7-46a1-4621-b165-dc782bf1d1ae','1c887a16-4344-4a80-8a11-f26d80824e4a',null,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14','c0e866f2-0389-4fe3-9b11-f9ed6f49dd66','a2f09cbb-1555-4c8d-b401-0233982cfa7e','64103b9f-b760-4add-8c43-dbc7ac501fda',1,null,'TRUE');
Insert into TRANSACTION (TRANSACTION_ID,OBJECT_TYPE,VERSION,CREATED,LAST_UPDATED,DESCRIPTION,EXTERNAL_ID,TYPE,STATE,LAST_STATE_CHANGE,CHANNEL,MANDATE_ID,SUBSCRIPTION_ID,BULK_REFUND_TASK_ID,GROSS_CURRENCY,GROSS_AMOUNT,TAX_CURRENCY,TAX_AMOUNT,PAYER_ID,PAYEE_ID,ON_BEHALF_OF_PAYEE,ORIGINAL_ID,TRANSFER_ID,EVENT_ID,TERM_ID,CHARGE,TAGS_AND_VALUES,EXPORT_PENDING) values ('3085c51d-6425-4974-b2fb-f5bdc4d08137','com.valista.trxe.model.Transaction',2,to_timestamp('15-AUG-11 12.31.23.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('15-AUG-11 12.31.44.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),'testCharge',null,'PAYMENT','CONFIRMED',to_timestamp('15-AUG-11 12.31.23.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),null,null,null,null,'USD',10,'USD',0,'e8a58763-9faa-4632-a2b3-747aa00fe9c4','9f285bf7-46a1-4621-b165-dc782bf1d1ae',null,null,'db78d04e-c23d-4601-9b0e-76e826e85e29',null,null,1,null,'TRUE');
Insert into TRANSACTION (TRANSACTION_ID,OBJECT_TYPE,VERSION,CREATED,LAST_UPDATED,DESCRIPTION,EXTERNAL_ID,TYPE,STATE,LAST_STATE_CHANGE,CHANNEL,MANDATE_ID,SUBSCRIPTION_ID,BULK_REFUND_TASK_ID,GROSS_CURRENCY,GROSS_AMOUNT,TAX_CURRENCY,TAX_AMOUNT,PAYER_ID,PAYEE_ID,ON_BEHALF_OF_PAYEE,ORIGINAL_ID,TRANSFER_ID,EVENT_ID,TERM_ID,CHARGE,TAGS_AND_VALUES,EXPORT_PENDING) values ('bafc4f83-d3b7-45f2-b35d-ba4101eebf3c','com.valista.trxe.model.Transaction',1,to_timestamp('15-AUG-11 12.31.44.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('15-AUG-11 12.31.44.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),'Settle: Payment Transaction Confirmed',null,'SETTLEMENT','CONFIRMED',to_timestamp('15-AUG-11 12.31.44.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),null,null,null,null,'USD',2,'USD',0,'9f285bf7-46a1-4621-b165-dc782bf1d1ae','1c887a16-4344-4a80-8a11-f26d80824e4a',null,'3085c51d-6425-4974-b2fb-f5bdc4d08137','9b5e384c-7ce9-4d7a-871e-5f418e737205','9c5cb90a-2035-490f-9ca7-c70f24a9010c','b70382c8-a05e-49c4-9919-ad765c5c5046',1,null,'TRUE');
Insert into TRANSACTION (TRANSACTION_ID,OBJECT_TYPE,VERSION,CREATED,LAST_UPDATED,DESCRIPTION,EXTERNAL_ID,TYPE,STATE,LAST_STATE_CHANGE,CHANNEL,MANDATE_ID,SUBSCRIPTION_ID,BULK_REFUND_TASK_ID,GROSS_CURRENCY,GROSS_AMOUNT,TAX_CURRENCY,TAX_AMOUNT,PAYER_ID,PAYEE_ID,ON_BEHALF_OF_PAYEE,ORIGINAL_ID,TRANSFER_ID,EVENT_ID,TERM_ID,CHARGE,TAGS_AND_VALUES,EXPORT_PENDING) values ('bbb6123b-8b70-45f2-b593-5b6bb2afd6b2','com.valista.trxe.model.Transaction',1,to_timestamp('15-AUG-11 10.18.56.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('15-AUG-11 10.18.56.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'Correction: Payment Transaction Confirmed',null,'SETTLEMENT','CONFIRMED',to_timestamp('15-AUG-11 10.18.56.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),null,null,null,null,'USD',2,'USD',0,'1c887a16-4344-4a80-8a11-f26d80824e4a','9f285bf7-46a1-4621-b165-dc782bf1d1ae',null,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14','bef6cea1-d188-44e6-a5cf-6282480e13c2','a2f09cbb-1555-4c8d-b401-0233982cfa7e','e4a0bb0b-7273-4f28-8681-04fc067cb80d',1,null,'TRUE');
My Query
select transaction_id as trx_id,
          last_updated,
          nvl((case when payee_id= '9f285bf7-46a1-4621-b165-dc782bf1d1ae' then gross_amount end),0) as credit,
          nvl((case when payer_id= '9f285bf7-46a1-4621-b165-dc782bf1d1ae' then gross_amount end),0) as debit,
          connect_by_root transaction_id root,
          rownum rn,
description as trx_desc
          from (select * from transaction order by last_updated )
          where type = 'SETTLEMENT'
               start with original_id is null
               connect by original_id = prior transaction_id order by last_updated
Result I got ( this is not a table just result set )
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,RN,TRX_DESC) values ('609f264b-1cef-4615-8f28-d8dae391dbba',to_timestamp('15-AUG-11 10.17.43.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),0,4,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14',1,'Correction: Payment Transaction Confirmed');
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,RN,TRX_DESC) values ('bbb6123b-8b70-45f2-b593-5b6bb2afd6b2',to_timestamp('15-AUG-11 10.18.56.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),2,0,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14',2,'Correction: Payment Transaction Confirmed');
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,RN,TRX_DESC) values ('c8ef1e7c-4134-45d8-9568-5da2fc41e137',to_timestamp('15-AUG-11 12.01.42.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),0,1,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14',3,'Correction: Payment Transaction Confirmed');
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,RN,TRX_DESC) values ('8243cc1d-614d-4cfd-9c3b-b5cd44b3a67f',to_timestamp('15-AUG-11 12.29.45.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),1,0,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14',4,'Correction: Payment Transaction Confirmed');
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,RN,TRX_DESC) values ('bafc4f83-d3b7-45f2-b35d-ba4101eebf3c',to_timestamp('15-AUG-11 12.31.44.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),0,2,'3085c51d-6425-4974-b2fb-f5bdc4d08137',5,'Settle: Payment Transaction Confirmed');
Result I want to get
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,RN,TRX_DESC) values ('609f264b-1cef-4615-8f28-d8dae391dbba',to_timestamp('15-AUG-11 10.17.43.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),0,4,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14',1,'Correction: Payment Transaction Confirmed');
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,RN,TRX_DESC) values ('bbb6123b-8b70-45f2-b593-5b6bb2afd6b2',to_timestamp('15-AUG-11 10.18.56.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),2,0,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14',2,'Correction: Payment Transaction Confirmed');
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,RN,TRX_DESC) values ('c8ef1e7c-4134-45d8-9568-5da2fc41e137',to_timestamp('15-AUG-11 12.01.42.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),0,1,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14',3,'Correction: Payment Transaction Confirmed');
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,RN,TRX_DESC) values ('8243cc1d-614d-4cfd-9c3b-b5cd44b3a67f',to_timestamp('15-AUG-11 12.29.45.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),1,0,'61db88ec-ade8-4cc3-90f3-e49fa26dcf14',4,'Correction: Payment Transaction Confirmed');
Insert into EXPORT_TABLE (TRX_ID,LAST_UPDATED,CREDIT,DEBIT,ROOT,RN,TRX_DESC) values ('bafc4f83-d3b7-45f2-b35d-ba4101eebf3c',to_timestamp('15-AUG-11 12.31.44.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'),0,2,'3085c51d-6425-4974-b2fb-f5bdc4d08137',1,'Settle: Payment Transaction Confirmed');
Explanation
Refer 5th record of the result set. It has a RN = 5 and I want to get RN = 1 for that since that has a different ROOT and since it's the oldest memeber.
So Iwant to get RN as
date root row_number or something just find the oldest memeber in a tree
15-AUG-11 10.17.43.000000000 AM     61db88ec-ade8-4cc3-90f3-e49fa26dcf14     1
15-AUG-11 10.18.56.000000000 AM     61db88ec-ade8-4cc3-90f3-e49fa26dcf14     2
15-AUG-11 12.01.42.000000000 PM     61db88ec-ade8-4cc3-90f3-e49fa26dcf14     3
15-AUG-11 10.25.56.000000000 AM     55db88ec-ade8-4cc3-90f3-e49fa26dcf14     1
15-AUG-11 10.27.56.000000000 AM     55db88ec-ade8-4cc3-90f3-e49fa26dcf14     2
15-AUG-11 10.55.56.000000000 AM     85db88ec-ade8-4cc3-90f3-e49fa26dcf14     1

Similar Messages

  • Display and edit currently selected row of ADF Table in ADF Form

    I have an ADF Read-only Table and ADF Form, which were created from the same Data Control.
    I need to be able to edit the selected row of the table in the form (just like in "Binding Data Controls to your JSF page" part of "Developing RIA Web Applications with Oracle ADF" Tutorial). However, I can't figure out how to do this :(
    I found the following solution on the Web: #{bindings.DeptView1.currentRow.dataProvider.dname} - but it doesn't work, since "the class oracle.jbo.server.ViewRowImpl does not have the property dataProvider".
    Sorry for the newbie question.
    Thanks in advance for any help!

    Hi,
    AFAIK, dataProvider is not supported on ADF BC, hence the error.
    If you have created ADF Read only table and form from the same data control you just need to refresh the form based on table selection to show up the selected record, to do which you just need to add partialTriggers property to the panelFormLayout and set its value to the id of table
    Sireesha

  • How open and edit the coherence.xml file?

    How can I open and edit the coherence.xml file?
    I cannot find the coherence.xml file in the coherence.jar package.
    Thank you,
    June

    If you are intent on changing the coherence.xml file, then you could use the JAR command (that comes with Java) to extract the coherence.xml file from coherence.jar and the later repackage the coherence.jar file using the udpated coherence.xml file, e.g.:
    C:\java\opt\coherence-331\lib>jar -xvf coherence.jar tangosol-coherence.xmlextracted: tangosol-coherence.xml>
    Instead of using JAR, on Windows you can associate the .JAR, .WAR and .EAR extensions with WinZip and use it to access / modify the contents of JAR files.
    However, the suggested approach is as follows, and does not include any changes to the tangosol.jar file:
    The tangosol-coherence-override-dev.xml file can be found in the coherence.jar file. After editing this file (in this case to define a unique value for the port system-property value for the multicast listener), save the file and add it to the server's classpath. When the server is executed, the values in the tangosol-coherence-override-dev.xml file will override any corresponding settings in the tangosol-coherence.xml file.Peace,
    Cameron Purdy | Oracle Coherence

  • Why does after i i have unzipped and edited the classes...

    Why after i have unzipped and edited the classes in the jar file and zipped them together again, it gives me the message "CAN NOT FIND MAIN CLASS"?
    This is after i have edited any class in the .jar zip.I did not edit the Manifest text file,can someone who has experienced this problem show me how to overcome it.
    Thank you.
    Edited by: Blade_runner on Aug 6, 2008 3:04 PM

    I hope you realize you're in the wrong forum.
    This is not a forum for Java issues experienced when doing some programming on a desktop computer.
    This is a forum for questions and issues about the graphical environment named Sun Java Desktop System (JDS) which runs on Solaris and Linux ...
    http://en.wikipedia.org/wiki/Java_Desktop_System
    Instead, you might consider:
    http://forums.sun.com/index.jspa?tab=java

  • Trouble with viewing font on spine of Photo book.  I can't find a way to view and edit the text which appears on the spine of the dustcover or the book itself when printed.

    I can't find a way to view and edit the text which appears on the spine of the dustcover or the photo book itself.  When I preview the book it appears on the dustcover and the book, but not when I'm back in the creation or editing windows.  I've printed 4 books in a series and two spines are one font size, and two others are a different font size.  One of the books has a shortened title on the book spine.

    The text on the spine will be the same text that is in the Title text box on the title page.  You can change the font and style of that text just like you change any text in Aperture. Aperture will size and center the spine text for you
    If you want the content or the font and style  of the text to be different from your Title box text then you have to trick the program a bit.  Put the text that you want in the spine into the Title text box and then move that box to a place on the page where it will not be visible when printed ( Y coordinate -1.0 inches for example).  Don't move it too far away or it will be hard to get back to in order to make an edit.    Then make a new text box on the title page and put the text you want on the cover in that.  (Or make a book without text on the cover , but with text on the spine). 
    You are 100% correct in that you can not preview this unless you preview the printed book

  • How do you post on the forum and edit the wiki?

    I'm interested in efficient ways of posting and editing the wiki. Do you know / use any?
    I'm currently using firefox + pentadactyl. Pressing Ctrl+i in a text area opens vim
    set editor='st -e vim'
    and I'm all set :-)

    Over two years ago, /dev/zero posted this interesting piece: https://bbs.archlinux.org/viewtopic.php?id=143444
    And this thread got me searching for "vim bbcode", and immediately, something interesting:
    Use Markdown Instead Of BBCode With Vimperator
    looks like a good idea. Or maybe just use something that makes editing bbcode easier (e.g. vim-surround rule, wait, I'll look that one up.)
    ... OK I'm done looking it up; here is one:
    let g:surround_{char2nr("c")} = "<code>\r</code>"
    let g:surround_{char2nr("u")} = "<url\1url: \r..*\r=&\1>\r</url>"
    The first one's basic; surrounds the target with code tags with the "c" replacement.
    This will prompt for URL and surround the target with proper URL bbcode if you use the "u" replacement.
    Combine such rules with autocmd and some bbcode syntax highlighting, it would make life easier with bbcode.
    Note I've used '<>' instead of '[]' to not confuse bbcode.
    As for the topic question, I use Firefox with pentadactyl in a tabbed container in i3. When I press Ctrl-i in a textarea, a VIM editor opens in a new i3 tab, at full size. This makes editing focused. When I need to look at the original web page, I just switch to the previous i3 tab and take a peek.
    Last edited by lolilolicon (2014-08-03 14:48:46)

  • Can I see and edit the adress book phone tags?

    Hi.
    Does anyone know if it's possible to see and edit the list of standart and costume phone tags on the Lion Adress Book?
    And can you sync it with iCloud with an iPhone?
    Thank you for the help.

    Have you tried using iMovie?

  • I shared a movie in iMovie and created a file with the movie but then now I cannot go back in and find the original version to make future edits. What am I missing here? how do i go back and edit the original?

    Hi! I need help! I created an imovie and then shared it and cannot go back in and edit the roigianl now. I am new to Imovie and am trying to figure this out quickly as i have to get this done by tonight. Thank you

    You might try using the add-on 'NoSquint' which allows numerous zoom options specific to each page you visit & keeps your settings - https://addons.mozilla.org/en-US/firefox/addon/nosquint/
    If you want to go back to 3.6x, you will find it here:
    http://www.mozilla.com/en-US/firefox/all-older.html
    In most cases you can simply "upgrade" (meaning downgrade) directly from the installation. It would be a good idea to save your passwords & bookmarks just to be on the safe side.

  • Can you move a row in a DataGridView to the first row and move the other rows down to make room?

    I'm using a DataGridView (I call it "dg") to display a list of items. I want the user to be able to position the cursor on a row in the middle of the list then click a button to move that row to the top of the list (and move the other rows between
    the first row and the row being moved down one row to accomodate the new first row).
    Robert Homes

    Hello,
    If the DataGridview does not have it's DataSource set we can use the following logic
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim data = (From T In DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells.Cast(Of DataGridViewCell)() Select T.Value).ToArray
    DataGridView1.Rows.RemoveAt(DataGridView1.CurrentRow.Index)
    DataGridView1.Rows.Insert(0, data)
    End Sub
    If the DataSource is set then we need to do what was done above but against the underlying data rather than the DataGridView itself. The base logic can be found in
    the following article in LanguageExtensions.vb but please note the code there is for a different type of move yet the logic is still the same in the end.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Is it possible to import a mock up from Omnigraffle into Reflow and edit the mockup on Reflow ?

    Is it possible to import a mock up from Omnigraffle into Reflow and edit the mockup on Reflow ?

    I don't have omnigraffle so I can tell for sure, but the main way in would be if you can get those things in omnigraffle to come into photoshop as layer shapes. Is there an omnigraffle forum to ask about better PSD export? Once you have the layers in the PSD then the import to Reflow should work well.
    Hope that helps,
    Chris

  • How to see and edit the SOURCE

    I'd like to see and edit the source of my pages on iWeb, is it possible ?
    Thanks

    A favorite among many is Taco. There is also a collection of other iWeb tools and resources here.
    -Mark

  • Where to go and edit the existing link URL link name

    Hi,
        I need to edit the existing link for our portal, please guide me where to go and edit the name of our url.
    eg: current url is https://www.abc.eu/irj/portal    want to change it to
           new    url is https://www.abcdef.eu/irj/portal
    regards,
    Afzal.

    Hi Afjal,
    This link will help your requirement.
    http://wiki.sdn.sap.com/wiki/display/EP/ChangePortalURL
    Thanks & Regards,
    cbr

  • HT204053 support states you can't merge apple ids, but it does give you an option to edit. Im sure there's a reason, but why can't I sign in to 1 account and edit the name to match the 2nd account?

    support states you can't merge apple ids, but it does give you an option to edit. Im sure there's a reason, but why can't I sign in to 1 account and edit the name to match the 2nd account?

    Shelady wrote:
    ... (wasn't even aware my gmail account had anything to do with Microsoft) ...
    It doesn't.  Gmail is owned by Google.
    Shelady wrote:
    Also can someone tell me how I report spam on my iPhone and iPad in a gmail account?
    Report it to Google:

  • How i can access and edit the table of database(.mdb) file through Labview

    Dear sir,
    I want to access and edit the table of database(.mdb) file through Labview and it should save.
    please tell me how i can do it.
    i am waiting for reply.
    regards
    Rajendra

    there are options aplenty for this.  First off, do you have the database connectivity toolset?  If so, You can do it from there.  Following the examples in labview. Or you can do a search for ADO or access database, and find plenty of VIs that can do this. 
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • I use a mac pro and have photos saved in Iphoto.  I have burned a disk and want to send to a friend who is a PC user and only has picassa.  Will she be able to open and edit the photos in picassa?

    I have saved photos in Iphoto and have burned them to a disk.  I want to send the disk to a friend who is a PC user and doesn't have IPhoto.  She has Picassa.  Will she be able to open and edit the photos from my disk on her PC in Picassa?

    Thanks.  That's a great relief.  Do you know if the photos will be correctly formated or will they change in Picassa?

Maybe you are looking for

  • Compiling jsp pages in wl 10.0 2 times slower than wl 9.1

    Hi: I have enterprise application. In weblogic 9 it took 4-5min to compile all the jsp pages, in weblogic 10 it takes 10-11min!! Is there anything I can do to speed it up?

  • *Full page bleed

    I have my printer (Epson 300) set for full page printing and it will print that way in CS5.  In LR3 I cannot get it to print full page.  The bleed space at the bottom of the page is 1/2" and I cannot (in custom moode) move a cell into that bottom 1/2

  • Not able to activate Java even after clicking "allow and remember"

    Hi, After opening a website in Mozilla Firefox it shows "Activate Java(TM) Platform SE 7 U. This plugin has security vulnerabilities" and after clicking "allow and remember in red plugin icon in the address bar" the website closes automatically. Agai

  • Does anyone have the problem of ios7 crashing all the time?

    I can be using my safari application to read news, or anything else, and it will just kick me back to my main application page.  Super frustrating,  has anyone else had this problem?! 

  • View Sales documents based on plants

    _My client wants to see the sales documents related to a particular plant?_ _How can we give authorization for VA03 restricting to a particular plant?_ _If it is not possible any other solution._ It is urgent. Can any body help in this regard. Thanks