should pivot work on sqlserver?

LabKey Support Forum (Inactive)
should pivot work on sqlserver? Ben Bimber  2011-05-31 07:32
Status: Closed
 
A group at harvard is using the SSP_Assay, which is defined in the SSP_Assay module. That module has a pivot query looking like:

SELECT
  s.Id,
  s.allele,
  max(s.Status) as result,

FROM assay.SSP_Summary s

GROUP BY s.Id, s.allele
PIVOT result BY allele

this runs fine on postgres, which is all i've historically been setup to test. they get the following error:

500: Unexpected server error
Internal error while parsing "/* * Copyright (c) 2010 LabKey Corporation * * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 */ --this query provides an overview of the MHC SSP results SELECT s.Id, s.allele, max(s.Status) as result, FROM assay.SSP_Summary s GROUP BY s.Id, s.allele PIVOT result BY allele"

is there any reason why you would expect pivot to behave different on sql server vs postgres?

thanks.
 
 
Matthew Bellew responded:  2011-06-01 13:41
I don't know of any reason it should matter, unless it has to do with case sensitivity of values in the allele column.

Does this query work with PIVOT commented out? Is there a stack trace in the log to go along with this?