{
  "data": {
    "debug": {
      "durationMs": 2,
      "extra": {
        "aggSql": "select null \"trackId\",\n       null \"track$title\",\n       null \"totalAmount\",\n       null \"quantity\",\n       count(*) \"total\"\nfrom (select\tt1.TrackId \"trackId\",\td3.Name \"track$title\",\tSUM(t1.UnitPrice * t1.Quantity) \"totalAmount\",\tSUM(t1.Quantity) \"quantity\"\tfrom InvoiceLine t1\t left join Track d3  on t1.TrackId=d3.TrackId left join Invoice d1  on t1.InvoiceId=d1.InvoiceId left join Album d5  on d3.AlbumId=d5.AlbumId where  1=1  and \td1.InvoiceDate >=?  and \td1.InvoiceDate <?  and \td5.ArtistId =?  and \td3.AlbumId =? \tgroup by t1.TrackId,\td3.Name) tx",
        "params": [
          "2012-01-01 00:00:00",
          "2013-01-01 00:00:00",
          90,
          107
        ],
        "sql": "select\tt1.TrackId \"trackId\",\td3.Name \"track$title\",\tSUM(t1.UnitPrice * t1.Quantity) \"totalAmount\",\tSUM(t1.Quantity) \"quantity\"\tfrom InvoiceLine t1\t left join Track d3  on t1.TrackId=d3.TrackId left join Invoice d1  on t1.InvoiceId=d1.InvoiceId left join Album d5  on d3.AlbumId=d5.AlbumId where  1=1  and \td1.InvoiceDate >=?  and \td1.InvoiceDate <?  and \td5.ArtistId =?  and \td3.AlbumId =? \tgroup by t1.TrackId,\td3.Name order by SUM(t1.UnitPrice * t1.Quantity) desc,\tt1.TrackId asc"
      },
      "normalized": {
        "groupBy": [
          {
            "field": "trackId"
          },
          {
            "field": "track$title"
          },
          {
            "agg": "SUM",
            "field": "totalAmount"
          },
          {
            "agg": "SUM",
            "field": "quantity"
          }
        ],
        "orderBy": [
          {
            "dir": "desc",
            "field": "totalAmount",
            "nullFirst": false,
            "nullLast": false
          },
          {
            "dir": "asc",
            "field": "trackId",
            "nullFirst": false,
            "nullLast": false
          }
        ],
        "slice": [
          {
            "field": "invoice$invoiceDate",
            "op": "[)",
            "value": [
              "2012-01-01",
              "2013-01-01"
            ]
          },
          {
            "field": "artist$id",
            "op": "=",
            "value": 90
          },
          {
            "field": "album$id",
            "op": "=",
            "value": 107
          }
        ]
      }
    },
    "hasNext": false,
    "items": [
      {
        "quantity": 1,
        "totalAmount": 0.99,
        "track$title": "Aces High",
        "trackId": 1344
      },
      {
        "quantity": 1,
        "totalAmount": 0.99,
        "track$title": "2 Minutes To Midnight",
        "trackId": 1345
      },
      {
        "quantity": 1,
        "totalAmount": 0.99,
        "track$title": "Losfer Words",
        "trackId": 1346
      },
      {
        "quantity": 1,
        "totalAmount": 0.99,
        "track$title": "Duelists",
        "trackId": 1348
      },
      {
        "quantity": 1,
        "totalAmount": 0.99,
        "track$title": "Powerslave",
        "trackId": 1350
      }
    ],
    "pagination": {
      "hasMore": false,
      "limit": 500,
      "rangeDescription": "显示第 1-5 条，共 5 条",
      "returned": 5,
      "start": 0,
      "totalCount": 5
    },
    "schema": {
      "columns": [
        {
          "dataType": "INTEGER",
          "name": "trackId",
          "title": "曲目或媒体 ID"
        },
        {
          "dataType": "STRING",
          "name": "track$title",
          "title": "曲目或媒体名称"
        },
        {
          "name": "totalAmount"
        },
        {
          "name": "quantity"
        }
      ],
      "summary": "按 曲目或媒体 ID、曲目或媒体名称 分组，统计 totalAmount、quantity，返回 5 条数据"
    },
    "total": 5,
    "totalData": {
      "total": 5
    }
  },
  "diagnostics": {
    "attributes": {},
    "warnings": []
  },
  "engine": "java",
  "runtimeApiVersion": "foggy-runtime-api/v1",
  "success": true
}
