help me out in solving this problem. my table is like below.
| UniqueId | ActivityName |
| 111 | activity1 |
| 112 | activity1 |
| 111 | activity2 |
| 113 | activity2 |
i want the result like below using sql pivoting query 2016
| UniqueId | activityname | activity1 | activity2 | |
| 111 | activity1 | yes | yes | |
| 112 | activity1 | yes | No | |
| 113 | activity2 | No | yes |

Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 27, 2020, 11:20 PM EDT
Please accept the answer if it will helpful for you
Thank you
Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 27, 2020, 10:17 PM EDT
There's two value in 111 but as per your expected output you want only activity1 show in activity name?
You want to show activity name in expacted output or
just like
uniqueID Activity1 Activity2
Anju D27 reputationPosted Jul 27, 2020, 10:47 PM EDT
Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 28, 2020, 12:14 AM EDT
Aman GuptaRank #193 · 12.4K reputationPosted Jul 28, 2020, 3:25 AM EDT
Anju D27 reputationPosted Jul 28, 2020, 5:10 AM EDT
Anju D27 reputationPosted Jul 28, 2020, 9:25 PM EDT
Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 28, 2020, 9:31 PM EDT
Anju D27 reputationPosted Jul 28, 2020, 9:36 PM EDT
Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 29, 2020, 1:30 AM EDT
Try this