SQL help

瀏覽次數:39 次
跳到第一則未讀訊息

ATM Consultants

未讀,
2012年10月2日 凌晨1:09:362012/10/2
收件者: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

未讀,
2012年10月2日 上午9:45:562012/10/2
收件者: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
回覆所有人
回覆作者
轉寄
0 則新訊息