Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tech-notes:sql:pivot [2022/09/22 13:11] – [Pivot of our Source Table] gerardorourketech-notes:sql:pivot [2022/09/22 13:21] (current) – [Pivot of our Source Table] gerardorourke
Line 36: Line 36:
 ==== Our Source Table ==== ==== Our Source Table ====
 Since the Header value for these two columns would end up as "Y" or "N" - which is not very helpful - lets change the value of the TransferCallType as per below: Since the Header value for these two columns would end up as "Y" or "N" - which is not very helpful - lets change the value of the TransferCallType as per below:
 +Note: this step is not particularly necessary - we could just change the column names at the end - in our final SQL table.
  
 <code sql> <code sql>
Line 79: Line 80:
 </code> </code>
  
-You can see above is a select * from our table Pivoted with the following line:+You can see above is a SELECT * of our **source** table Pivoted with below following line:
 <code sql>Pivot( Max(CallsQueuedNow) FOR TransferCallType IN ([CIQ_IVR],[CIQ_Transfer]) ) </code> <code sql>Pivot( Max(CallsQueuedNow) FOR TransferCallType IN ([CIQ_IVR],[CIQ_Transfer]) ) </code>
  
  • tech-notes/sql/pivot.1663848713.txt.gz
  • Last modified: 2022/09/22 13:11
  • by gerardorourke