PIVOTクエリのヘルプ
私は以下の構造を持つテーブルを持っています: CREATE TABLE [dbo].[AUDIT_SCHEMA_VERSION]( [SCHEMA_VER_MAJOR] [int] NOT NULL, [SCHEMA_VER_MINOR] [int] NOT NULL, [SCHEMA_VER_SUB] [int] NOT NULL, [SCHEMA_VER_DATE] [datetime] NOT NULL, [SCHEMA_VER_REMARK] [varchar](250) NULL ); いくつかのサンプルデータ(sqlfiddleに問題があるようです。 INSERT INTO [AUDIT_SCHEMA_VERSION]([SCHEMA_VER_MAJOR],[SCHEMA_VER_MINOR],[SCHEMA_VER_SUB],[SCHEMA_VER_DATE],[SCHEMA_VER_REMARK]) VALUES(1,6,13,CAST('20130405 04:41:25.000' as DATETIME),'Stored procedure build') INSERT INTO [AUDIT_SCHEMA_VERSION]([SCHEMA_VER_MAJOR],[SCHEMA_VER_MINOR],[SCHEMA_VER_SUB],[SCHEMA_VER_DATE],[SCHEMA_VER_REMARK]) VALUES(1,6,13,CAST('20130405 04:41:25.000' as DATETIME),'Stored procedure build') INSERT INTO [AUDIT_SCHEMA_VERSION]([SCHEMA_VER_MAJOR],[SCHEMA_VER_MINOR],[SCHEMA_VER_SUB],[SCHEMA_VER_DATE],[SCHEMA_VER_REMARK]) VALUES(1,7,13,CAST('20130405 04:41:25.000' as DATETIME),'Stored …