![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello all, DB2 v9.5 LUW Fixpack 5. create table TESTE ( MACHINE_ID VARCHAR (24), LOGIN_NAME VARCHAR (32), EVENT_TIME TIMESTAMP, OPERATION CHAR (1) ); insert into TESTE values ('00000000001007B70BCB1546','wiocpere','2011-05-16-08.01.49.000000','I'), ('00000000001007B70BCB1546','wiocpere','2011-05-16-08.47.49.000000','U'), ('00000000001007B70BCB1546','wiocpere','2011-05-16-09.23.41.000000','I'), ('00000000001007B70BCB1546','wiocpere','2011-05-16-16.17.49.000000','U'), ('00000000001007B70BCB1546','wiocpere','2011-05-17-07.11.41.000000','I'), ('00000000001007B70BCB1546','wiocpere','2011-05-17-08.47.49.000000','U'), ('00000000001007B70BCB1546','wiocpere','2011-05-18-09.23.41.000000','I'); My application needs detect when a completed event happened (Instalation / Uninstalation ). Ex. MACHINE_ID LOGIN_NAME EVENT_TIME OPERATION ------------------------ ------------------------------ -------------------------- --------- 00000000001007B70BCB1546 wiocpere 2011-05-16-08.01.49.000000 I 00000000001007B70BCB1546 wiocpere 2011-05-16-08.47.49.000000 U 00000000001007B70BCB1546 wiocpere 2011-05-16-09.23.41.000000 I 00000000001007B70BCB1546 wiocpere 2011-05-16-16.17.49.000000 U 00000000001007B70BCB1546 wiocpere 2011-05-17-07.11.41.000000 I 00000000001007B70BCB1546 wiocpere 2011-05-17-08.47.49.000000 U 00000000001007B70BCB1546 wiocpere 2011-05-18-09.23.41.000000 I EVENT_TIMEs ( 2011-05-16-08.01.49.000000 and 2011-05-16-08.47.49.000000 ) is a completed event. (Installation and Uninstallation ). EVENT_TIMEs ( 2011-05-16-09.23.41.000000 and 2011-05-16-16.17.49.000000 ) is a completed event. (Installation and Uninstallation ). EVENT_TIMEs ( 2011-05-17-07.11.41.000000 and 2011-05-17-08.47.49.000000 ) is a completed event. (Installation and Uninstallation ). EVENT_TIME ( 2011-05-18-09.23.41.000000 ) is a incompleted event ( Just installation ). I need return, this result set: MACHINE_ID LOGIN_NAME EVENT_TIME_INST OPERATION EVENT_TIME_UNINST OPERATION COMPLETED ------------------------ ------------------------------ -------------------------- --------- -------------------------- --------- ---------- 00000000001007B70BCB1546 wiocpere 2011-05-16-08.01.49.000000 I 2011-05-16-08.47.49.000000 U Y 00000000001007B70BCB1546 wiocpere 2011-05-16-09.23.41.000000 I 2011-05-16-16.17.49.000000 U Y 00000000001007B70BCB1546 wiocpere 2011-05-17-07.11.41.000000 I 2011-05-17-08.47.49.000000 U Y 00000000001007B70BCB1546 wiocpere 2011-05-17-09.23.41.000000 I - - N Is there a way to get this result set? |
![]() |
| Thread Tools | |
| Display Modes | |
| |