Subversion Repositories DevTools

Rev

Rev 4557 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4557 Rev 4653
Line 1... Line 1...
1
/* Package Action Log */
1
/* Package Action Log */
2
/* Stange query attempts to retain the order of the entries */
-
 
3
/* The date format is not strong enough to ensure correct ordering */
-
 
4
/* The user should have used a timestamp instead */
-
 
5
select alog.action_datetime, 
2
SELECT alog.action_datetime, 
6
	   usr.FULL_NAME,
3
	   usr.FULL_NAME,
7
       usr.USER_EMAIL, 
4
       usr.USER_EMAIL, 
8
       acttype.description as acttype, 
5
       acttype.description as acttype, 
9
       alog.description
6
       alog.description,
10
       from (
-
 
11
        SELECT  rownum as rn, action_datetime, ACTTYPE_ID, USER_ID, description
7
       TO_CHAR(alog.action_timestamp, 'Dy DD-Mon-YYYY HH24:MI:SSxFF1') as action_timestamp
12
        FROM ACTION_LOG 
8
  FROM ACTION_LOG alog, ACTION_TYPE acttype, USERS usr
13
        WHERE PV_ID = :PV_ID
9
 WHERE alog.PV_ID = :PV_ID
14
 ) alog
-
 
15
   join USERS usr on alog.user_id = usr.user_id
10
   AND alog.ACTTYPE_ID = acttype.ACTTYPE_ID 
16
   join ACTION_TYPE acttype on alog.acttype_id = acttype.acttype_id
11
   AND alog.USER_ID = usr.USER_ID
17
order by alog.action_datetime DESC, alog.rn DESC
12
 ORDER BY ( alog.ACTION_TIMESTAMP ) DESC  
-
 
13