Results 1 to 2 of 2

Thread: Help with DB2 Syntax

Threaded View

  1. #2
    Join Date
    Aug 2003
    Location
    Moscow, Russia
    Posts
    3

    Lightbulb

    Lets name first query (columns serv_hostname, year, month, disk_drive, value) as QRY.

    SELECT serv_hostname, year, month, SUM(CASE WHEN disk_drive='c:' THEN value ELSE 0 END) AS C, SUM(CASE WHEN disk_drive='D:' THEN value ELSE 0 END) AS D FROM QRY GROUP BY serv_hostname, year, month

    (Sample is actual for DB2/400, may work on PC-version too.)
    Last edited by moron; 08-07-2003 at 05:30 AM.

Posting Permissions

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