Counters in tables
MaheshGxMar 15 2012 — edited Mar 15 2012Hi,
I have onerequirement.
I have a table having structure as
CREATE TABLE "OMPODI"."BAR_SAP"
(
"FILENAME" CHAR(31 BYTE),
"FILEDATE" DATE,
"COUNTER" NUMBER(3,0)
)
At first it will have data as 'File', sysdate, 001.
But while inserting next time i want check if data inserted last time was on same date, if its on same date then counter should be counter + 1 else counter will be reset to 1.
How can i achieve this?
any suggestive insert statements or some way of achieveing it.
Thanks and Regarsds,
Mahesh