Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    28

    Unanswered: SQL Assistance Needed

    The following SQL:

    Select endpoint_label, Name, Avg(MetricValue)
    From LM_MEM
    Where (((Name = 'Availbytes') or (Name = 'PagesInputPerSec')) and Stat = 'AVG')
    Group By endpoint_label, Name

    produces two lines per endpoint_label.

    I want to have one line per endpoint_label and I'm not successful in my attempts at this.
    I'm trying for an end result such as:
    endpoint_label, Availbytes, PagesInputPerSec
    xxx1234xxxxxx, 6.123456, 15.446223
    xxx1001xxxxxx, 6.673322, 15.977110

    When I'm able to list each endpoint_label once, the Avg(MetricValue) for the two Names is incorrect and it's repeated for every row.
    endpoint_label, Availbytes, PagesInputPerSec
    xxx1234xxxxxx, 1.123456, 1.34876
    xxx1001xxxxxx, 1.123456, 1.34876

    Any assistance on this would be greatly appreciated.

  2. #2
    Join Date
    Oct 2004
    Location
    DELHI INDIA
    Posts
    338
    Try adding MetricValue in the Group By clause.

Posting Permissions

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