SQL help

41 views
Skip to first unread message

ATM Consultants

unread,
Oct 2, 2012, 1:09:36 AM10/2/12
to ORACLE_DB...@googlegroups.com
Hey,

I have a table with following structure

Table_Name: TEST
COL1: OBJ_ID number(19) not null monotonically increasing number
COL2: CR_DATE TIMESTAMP(3) not null
COL3: LAST_UPD TIMESTAMP(3) not null

The SQL that is required:

1. count the number of occurrence when same OBJ_ID has repeated with cr_date > (last_upd of the previous occurrence of the same OBJ_ID) + 2 secs
We need to ignore the cases when same OBJ_ID has re-occured but the CR_DATE is far (> 2secs) away of LAST_UPD of previous version.

- S

ddf

unread,
Oct 2, 2012, 9:45:56 AM10/2/12
to oracle_db...@googlegroups.com, ORACLE_DB...@googlegroups.com
I see no indication that you have even attempted to solve this problem.  Also the problem definition, sparse as it is, makes question 1, if I understand how OBJ_ID is generated, invalid as you can't have the same OBJ_ID occurring more than once in this table (the 'monotonically increasing number' definition, which means a sequence).  Of course your description of the problem could be wrong.

If you want help then  you need to do the following:

1) Provide a COMPLETE description of the problem, including setup [table creation and population].
2) Make an attempt to solve this yourself; provide your code and any output you receive
3) Do NOT ask US to do your homework for you.  We won't, plainly and simply put.


David Fitzjarrell
Reply all
Reply to author
Forward
0 new messages