Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2014

    Unanswered: Combining results

    GOod morning,

    I have a query built to average turn times bases on an issue type. Here is the code:

    SELECT issue_type, AVG(turn_time) AS Avgturntime from(SELECT issue_type,(date_resolved-date_created) AS turn_time FROM JIRA17.FCI4JIRA_COMMON_VIEW
    Where (DATE_RESOLVED BETWEEN TO_DATE('11/01/2013', 'MM/DD/YYYY') and TO_DATE('11/30/2013', 'MM/DD/YYYY')))
    Group by issue_type

    The resulting output works, but inside of the issue type field I have tasks and sub-tasks. I would like to combine them. For example, I will get the following:

    + Issue_type +Avgturntime+
    + -----------+-----------+
    + MIS + 92.5 +
    +MIS Subtask+ 15.8 +

    How can I have the task and sub-task combined in the output? Also this is running on PL/SQL.

    Any help would be appreciated as I am new to this.

    Last edited by Kneeds; 01-17-14 at 11:00.

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    >Any help would be appreciated as I am new to this.
    Then you should avoid using TYPE datatype as they are difficult to use (as you have learned).

    >Also this is running on PL/SQL.
    What does above mean?

    since we don't have your tables or data we can not run, test, or improve posted code.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Feb 2008
    How to know a value of Issue_type(in your example, 'MIS Subtask') is a sub-task of another task(in your example, 'MIS')?

    Your example was only one pair of task and sub-task.
    From the example,
    I might be able to suppose sub-tasks always expressed by a word 'Subtask'.
    If the supposition was right,
    GROUP BY REPLACE(Issue_type , 'Subtask')
    might be an answer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts