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.