dominos coupon code

shopclues coupon code today

amazon coupon codes india

cleartrip coupons for domestic flights

Promo code offers

How to use a Pivot query in SQL Server ?

TABLE [dbo].[Salary](
[SalaryId] [int] IDENTITY(1,1) NOT NULL,
[EmpId] [varchar](50) NULL,
[SalaryMonth] [date] NULL,
[SalaryAmt] [decimal](18, 0) NULL,

//=====================PIVOT Query============================

Select pv.* From
(
Select * From (
Select EmpId,Month(SalaryMonth)Months,SalaryAmt From Salary
) sal
PIVOT (SUM(SalaryAmt)for Months in([1],[2],[3]) )As p
)pv

About Ashraful Islam

Leave a Reply

Your email address will not be published. Required fields are marked *