Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8720

Re: SQL Pivot Query

$
0
0

Hi,

 

The pivot query looks like below. You can limit by selecting required column to display in title. This is sample only.

 

Select [1] as DES, [2] as PRN, [3] as PRS, [4] as SEW,
[5] as EMB, [date] as WE14/02/2014

From
( select (T1.U_DES_STAGE) as 1, (T1.U_PRN_STAGE) as 2, (T1.U_PRS_STAGE) as 3, (T1.U_SEW_STAGE) as 4, (T1.U_EMB_STAGE) as 5,
(T1.Quantity) as Qty, (T1.U_DES_STAGE_Date) as Date.....

from ORDR T0 inner join RDR1 T1on T0.docentry  = T1.docentry ) S

Pivot
(Sum(Qty) For DATE IN (........) P

 

Thanks & Regards,

Nagarajan


Viewing all articles
Browse latest Browse all 8720

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>