Pivot in sql server

前端 未结 4 1340
南旧
南旧 2020-12-07 05:50

Yes I\'ve tried the code. My requirement is that user inputs Year and Month & prices are shown date-wise in columns for that year and month, with first column as Competi

4条回答
  •  没有蜡笔的小新
    2020-12-07 06:20

    CASE 
    WHEN SQL Server 2005 OR 2008 THEN Use Pivot 
    WHEN Oracle THEN Use LIKE MAX(Decode(Day=1,Data,0) as Day1 and GROUP BY Day
    WHEN SQL Server 2000 THEN Use LIKE MAX(CASE WHEN Day = 1 THEN Data ELSE 0 End) As Day1 and GROUP BY Day 
    END
    

提交回复
热议问题