ID NOT NULL NUMBER(38)
ACCOUNTNUMBER NOT NULL NUMBER(38)
ORIGINATINGACCOUNT NOT NULL NUMBER(38)
STARTTIME NOT NULL DATE
ENDTIME NOT NULL DATE
USAGETYPE NOT NULL NUMBER(10)
TRANSACTIONID NOT NULL NUMBER(38)
PK is ID
Transaction ID is not unique and is generated randomly..
I want to know the latest generated transactionid and the max(id) for that transaction..
How would I write the sql..
If latest generated transaction id is 62 and then 99, I want the id that is max for these transactionid (6 and 4)..
I hope I am clear..
your question should have peen posted to the "Oracle development" forum, but anyway ... since I do not know how you identify the latest generated transactions, here is a request that will give you the max(ID) for all the transaction_ids, you just have to add some things in the where clause of the transaction ...
select a.transaction_id, a.id
from table a
where a.id =
(select max b.id from table b
Click Here to Expand Forum to Full Width