I'm basically using php with access to remote SQL server, and then formatting in JSON to display on a iPhone app. I'cant really see an easy way to dump the database as its not managed by me. – Simon Unsworth

MIN and MAX come to mind. SUM also works for numeric data. Therefore the solution to specifying a PIVOT without an aggregate is instead to specify such a "pass through" aggregate here. Basically, PIVOT internally works a lot the same as GROUP BY. Except the grouping columns are all columns in the current result set other than the column

CtBPg.
  • b7jmkobk35.pages.dev/34
  • b7jmkobk35.pages.dev/480
  • b7jmkobk35.pages.dev/346
  • b7jmkobk35.pages.dev/238
  • b7jmkobk35.pages.dev/271
  • b7jmkobk35.pages.dev/179
  • b7jmkobk35.pages.dev/424
  • b7jmkobk35.pages.dev/346
  • how to use pivot in sql