Column Name Type Copies ELECTRICAL MACHINES -II Issue 48 ELECTRICAL MACHINES -II Reference 2
Name Reference Issue ELECTRICAL MACHINES -II 2 48
SELECT [Name], [Reference], [Issue] FROM ( SELECT [Name], [Type], [Copies] FROM MyTable ) AS DT PIVOT(MAX(Copies) FOR [Type] IN ([Reference], [Issue])) AS PT
SELECT BookTitle, Library_Department_ID, SectorID, [Reference], [Issue]FROM ( SELECT BookTitle, Library_Department_ID, SectorID, NoofCopies, CASE WHEN [Status] = 1 THEN 'Reference' ELSE 'Issue' END FROM tbl_bookmst WHERE Status= 1) AS DTPIVOT(SUM(NoofCopies) FOR [Status] IN([Reference], [Issue])) AS PT
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)