Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. select trunc(createddate,'dd') timed,trunc(createddate,'hh24') timem,trunc(createddate,'mi') timest, 'created', GROUPID, HANDLERSCRIPT, ERRORDESCRIPTION, avg((lastupdateddate-createddate)*24*60), count(1) obs
  2. from eoc.ON_MOM_MESSAGES_ARCHIVE
  3. WHERE createddate > CAST (:sql_last_value AS date)
  4. group by trunc(createddate,'dd'),trunc(createddate,'hh24'),trunc(createddate,'mi'), GROUPID, HANDLERSCRIPT, ERRORDESCRIPTION
  5. union all
  6. select trunc(createddate,'dd') timed,trunc(createddate,'hh24') timem,trunc(createddate,'mi') timest, 'created', GROUPID, HANDLERSCRIPT, ERRORDESCRIPTION, avg((lastupdateddate-createddate)*24*60), count(1) obs
  7. from eoc.ON_MOM_MESSAGES
  8. WHERE createddate > CAST (:sql_last_value AS date)
  9. AND status = 3
  10. group by trunc(createddate,'dd'),trunc(createddate,'hh24'),trunc(createddate,'mi'), GROUPID, HANDLERSCRIPT, ERRORDESCRIPTION
  11. union all
  12. select trunc(lastupdateddate,'dd') timed,trunc(lastupdateddate,'hh24') timem,trunc(lastupdateddate,'mi') timest, 'finished',GROUPID, HANDLERSCRIPT, ERRORDESCRIPTION, avg((lastupdateddate-createddate)*24*60), count(1) obs from eoc.ON_MOM_MESSAGES_ARCHIVE
  13. WHERE createddate > CAST (:sql_last_value AS date)
  14. group by trunc(lastupdateddate,'dd'),trunc(lastupdateddate,'hh24'),trunc(lastupdateddate,'mi'), GROUPID, HANDLERSCRIPT, ERRORDESCRIPTION
  15. union all
  16. select trunc(lastupdateddate,'dd'),trunc(lastupdateddate,'hh24'),trunc(lastupdateddate,'mi') timest, 'finished_error', GROUPID, HANDLERSCRIPT, ERRORDESCRIPTION,avg((lastupdateddate-createddate)*24*60), count(1) obs from eoc.ON_MOM_MESSAGES
  17. where status = 3
  18. AND createddate > CAST (:sql_last_value AS date)
  19. group by trunc(lastupdateddate,'dd'),trunc(lastupdateddate,'hh24'),trunc(lastupdateddate,'mi'), GROUPID, HANDLERSCRIPT, ERRORDESCRIPTION
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement