I have a requirement where my query will return output something like this:
PermissionType IsAllowed ------------------------- IsEdit | 1 IsDelete | 0 isRemove | 1 isPrint | 1 isReport | 0 -- | - -- | - -- | - --------------------------
These rows can be dynamic depending upon the filter criteria I will pass.
So now I want to convert the above resultset to the following:
IsEdit | IsDelete | IsRemove | IsPrint | IsReport | -- | -- | -- -------------------------------------------------------------------- 1 | 0 | 1 | 1 | 0 | - | - | -
I tried to use the pivot here but it asks the Column Names to be pivoted into the output and this is dynamic in my case, also it needed an aggregate function for FOR
but I don't have any calculation in my case.
Anyone please help me on this.