Is there a way where I can pivot multiple columns from my table to pivot into 3 currencies (LAK, THB, USD). The columns I want to pivot are premium, discountedPremium, registryFee, vat, etc. Please see image below.

I want the result to be like in the image below:

thank you for your guidance.

Tuhin PaulPosted Jul 30, 2024, 3:02 PM
A Common Table Expression (CTE) to pivot each field individually based on the currency and then aggregates the results using
MAXto removeNULLvalues and get the desired format.Jes SiePosted Sep 2, 2022, 3:11 AM
Nitin SontakkePosted Sep 1, 2022, 5:46 PM
Jes SiePosted Sep 1, 2022, 8:03 AM
Nitin SontakkePosted Aug 31, 2022, 4:58 AM
Jes SiePosted Aug 31, 2022, 4:36 AM
Nitin SontakkePosted Aug 4, 2022, 7:58 AM
Nitin SontakkePosted Aug 4, 2022, 7:54 AM
Vishal JoshiPosted Aug 4, 2022, 7:19 AM